| Crates.io | rotating_file_handler |
| lib.rs | rotating_file_handler |
| version | 0.2.0 |
| created_at | 2025-03-24 14:32:13.579441+00 |
| updated_at | 2025-03-25 18:09:21.112886+00 |
| description | Implements a simple rotating file handler. |
| homepage | |
| repository | https://github.com/flocked-agriculture/rotating_file_handler |
| max_upload_size | |
| id | 1603841 |
| size | 17,998 |
This crate contains a simple rotating file handler. It is intended for high frquency robust telemetry logging on physical systems.
Install with cargo:
cargo add rotating_file_handler
Simple example for creating a file handler and logging binary data.
use std::io::Write;
use rotating_file_handler::RotatingFileHandler;
fn main() -> std::io::Result<()> {
let mut handler = RotatingFileHandler::new("docs_log.txt", 1024, 3, None)?;
handler.emit(b"Hello, world!")?;
handler.emit(b"Logging some more data...")?;
Ok(())
}
Licensed under either of the following:
Public contribution is welcome and encouraged. Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
This is a relatively simple developer facing crate so documentation should primarily exist in line per the rust documentation. Anything that does not associated with a specific block of code such as crate requirements, installation instructions, etc should be documented in this README.md.
Releases are managed through both git tags and branches. Branches are used for convenience and tags actually trigger the relevant release actions. Whenever there is a new major or minor release a branch must be created at the relevant hash in the format v<major>.<minor> (ie v1.33). Branches with such a format are protected by a ruleset and can only be modified by admins. All release tags must point to hashes on said branch. There is also a ruleset protecting all git tags matching the semantic versioning format v*.*.* so that only admins can add such tags.
In summary, you must be an admin and complete the following steps:
The git tag will kick off an automated process that deploys the crate to crates.io after validating crate version matches the tag version and all automated tests pass.