| Crates.io | sir_logger |
| lib.rs | sir_logger |
| version | 0.1.1 |
| created_at | 2025-09-03 17:57:43.214731+00 |
| updated_at | 2025-09-03 17:59:12.35575+00 |
| description | A simple logging library similar to env_logger |
| homepage | https://github.com/SirSpudlington/sir_logger |
| repository | https://github.com/SirSpudlington/sir_logger |
| max_upload_size | |
| id | 1822977 |
| size | 59,890 |
This is a simple crate that I tend to use in a lot of projects. I used to just copy the crate between all of my projects and after the 8th time, I have decided to just open-source the thing.
This is just a somewhat personalized version of env_logger, env_logger is better in almost every way.
Note:
warn and error logs for other libraries unless set to trace.no-panic-handler feature)fn main() {
sir_logger::setup(
// The log filter override, if `Some(value)`,
// the logger will use that value as the log level displayed.
// If `None`, then the logger will try to find the value in
// `RUST_LOG`, and then it'll default to `INFO`
Some(LevelFilter::Trace),
// The names of crates that should be disabled for the logger
["very_verbose_crate"],
// The names of libraries that should be at the same log
// level as the main program.
["super_important_crate"],
// A path to a file to store logs, or `None`
Some("path/to/log.txt"),
// The name of this executable, this'll help the library
// set the correct log level for all crates.
env!("CARGO_PKG_NAME")
);
}

