-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: automatic cleanup functionality for logs file
- Loading branch information
1 parent
2ec58ef
commit ae6a2ab
Showing
5 changed files
with
203 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
![Speak Easy — Logging functionalities][splash] | ||
|
||
[splash]: https://raw.githubusercontent.com/stefanodecillis/speak-easy/main/assets/crab-contained.jpg | ||
|
||
# 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`: | ||
|
||
```toml | ||
[dependencies] | ||
speak-easy = "0.1.0" | ||
``` | ||
|
||
Then, use the library in your code like this: | ||
|
||
|
||
```rust | ||
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. | ||
|
||
|
||
|
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters