# Fone Crate
[](https://crates.io/crates/fone)
[](https://docs.rs/fone)
The `fone` crate is a lightweight utility library for Rust that provides:
- **Arithmetic Operations**: Simple functions for performing basic math.
- **Logging Utilities**: Macros for in-memory and file-based logging with support for different severity levels.
## Features
- **Arithmetic Utilities**:
- [add](https://docs.rs/fone): Adds two integers.
- **Logging Utilities**:
- In-memory logging: `logi!`, `logd!`, `logw!`, `loge!`
- File-based logging: `logfi!`, `logfd!`, `logfw!`, `logfe!`
## Installation
Add the following to your `Cargo.toml`:
```toml
[dependencies]
fone = "0.1.0"
```
### Usage
```rust
use fone::add;
fn main() {
let result = add(2, 2);
println!("Result: {}", result);
}
```
```rust
use fone::{logi, logd, logw, loge};
fn main() {
logi!("Application initialized");
logd!("Configuration loaded");
logw!("Deprecated API used");
loge!("Critical system failure");
}
```
```rust
use fone::{logfi, logfd, logfw, logfe};
fn main() {
logfi!("Application initialized");
logfd!("Configuration loaded");
logfw!("Deprecated API used");
logfe!("Critical system failure");
}
```
## Testing
To run the test suite:
```bash
cargo test -- --show-output
cargo test -v
```
The tests validate:
- Arithmetic functionality.
- In-memory logging behavior.
- File-based logging behavior.
## Documentation
Generate and view the documentation locally:
```bash
cargo doc --open
```
For online documentation, visit [docs.rs/fone](https://docs.rs/fone).
## Contributing
Contributions are welcome! Please ensure that:
- New features include appropriate tests.
- Documentation is updated for all public APIs.
- Code adheres to Rust best practices and formatting standards.
## License
This project is licensed under the MIT License. See [LICENSE](LICENSE) for details.
```
---
### Summary of Changes
1. **Crate-Level Documentation**: Added to `lib.rs` or `main.rs` to describe the crate's purpose, features, and usage.
2. **Function-Level Documentation**: Added to each public function and macro to explain their behavior and provide examples.
3. **README.md**: Created to provide a high-level overview of the crate, installation instructions, usage examples, and contribution guidelines.
With these updates, the `fone` crate will have comprehensive documentation that supports `cargo doc` generation and provides a clear README for users.