Replace all output with macros from logging library

This commit is contained in:
Matthias Beyer 2015-10-26 20:55:31 +01:00
parent 127c99f16f
commit 7f224e8f58
3 changed files with 3 additions and 3 deletions

View file

@ -19,5 +19,5 @@ fn main() {
let logger = ImagLogger::init(&config); let logger = ImagLogger::init(&config);
let rt = Runtime::new(config); let rt = Runtime::new(config);
println!("Hello, world!"); info!("Hello, world!");
} }

View file

@ -37,8 +37,7 @@ impl Error for ModuleError {
impl Display for ModuleError { impl Display for ModuleError {
fn fmt(&self, f: &mut Formatter) -> FMTResult { fn fmt(&self, f: &mut Formatter) -> FMTResult {
write!(f, "ModuleError: {}", write!(f, "ModuleError: {}", self.description())
self.description())
} }
} }

View file

@ -36,6 +36,7 @@ impl ImagLogger {
fn init_logger(lvlflt : LogLevelFilter) -> Result<(), SetLoggerError> { fn init_logger(lvlflt : LogLevelFilter) -> Result<(), SetLoggerError> {
log::set_logger(|max_log_lvl| { log::set_logger(|max_log_lvl| {
max_log_lvl.set(lvlflt); max_log_lvl.set(lvlflt);
debug!("Init logger with: {}", lvlflt);
Box::new(ImagLogger::new(lvlflt.to_log_level().unwrap())) Box::new(ImagLogger::new(lvlflt.to_log_level().unwrap()))
}) })
} }