2 releases
0.1.1 | May 17, 2024 |
---|---|
0.1.0 | May 16, 2024 |
#351 in Profiling
281 downloads per month
205KB
192 lines
Speak-Easy
Speak-Easy is a Rust library that provides logging functionalities with different levels and rotation options built on top of tokio-rs tracing.
Features
- Different log levels
- Log rotation options
- Cleanup functionality
Usage
First, add the following to your Cargo.toml
:
[dependencies]
speak-easy = "0.1.1"
Then, use the library in your code like this:
use speak_easy::{SpeakEasy, SpeakConfig, Rotation};
let speak_config = SpeakConfig::new(Rotation::Minutely, "./logs".to_string(), "my_log".to_string())
.with_cleanup(24 * 60 * 60, 5);
SpeakEasy::init(Level::INFO, Some(config));
Please replace "/path/to/log/files" with the actual path where you want to store your log files.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Contributing
Feel free to open issues and send PRs. We will evaluate them together in the comment section.
Dependencies
~5.5–7.5MB
~125K SLoC