2 releases
0.1.1 | Oct 4, 2024 |
---|---|
0.1.0 | Oct 4, 2024 |
#282 in Debugging
281 downloads per month
8KB
135 lines
loggers
Loggers
Installation
cargo add loggers
Examples
use loggers::*;
let mut logger = Logger::new();
logger.add_logger(Box::new(CustomLogger::new(
"test",
"tests/output/system.log",
)));
logger.set_fallback(Box::new(CustomLogger::new(
"default",
"tests/output/system.log",
)));
log::set_boxed_logger(Box::new(logger)).expect("Failed to set logger");
log::set_max_level(log::LevelFilter::Trace);
info!(target:"test", "Hello, world!");
debug!("Default");
License: Apache-2.0
lib.rs
:
Loggers
Installation
cargo add loggers
Examples
use loggers::*;
let mut logger = Logger::new();
logger.add_logger(Box::new(CustomLogger::new(
"test",
"tests/output/system.log",
)));
logger.set_fallback(Box::new(CustomLogger::new(
"default",
"tests/output/system.log",
)));
log::set_boxed_logger(Box::new(logger)).expect("Failed to set logger");
log::set_max_level(log::LevelFilter::Trace);
info!(target:"test", "Hello, world!");
debug!("Default");
Dependencies
~1.4–2.3MB
~40K SLoC