2 releases

0.1.1 Oct 4, 2024
0.1.0 Oct 4, 2024

#282 in Debugging

Download history 209/week @ 2024-09-29 47/week @ 2024-10-06 24/week @ 2024-10-13 1/week @ 2024-10-20

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