Crates.io | loggers |
lib.rs | loggers |
version | 0.1.1 |
source | src |
created_at | 2024-10-04 10:48:52.089093 |
updated_at | 2024-10-04 10:53:18.227594 |
description | simple logger |
homepage | |
repository | |
max_upload_size | |
id | 1396376 |
size | 19,807 |
cargo add loggers
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