2 releases

0.1.1 Oct 4, 2024
0.1.0 Oct 4, 2024

#285 in Debugging

Download history 158/week @ 2024-09-28 94/week @ 2024-10-05 28/week @ 2024-10-12 1/week @ 2024-10-19

281 downloads per month

Apache-2.0

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