fix a bug in log level determination from env
@@ -52,15 +52,15 @@ custom_error! {ProgramError
// As broot is a terminal application, we only log to a file (dev.log)
fn configure_log() {
let level = env::var("BROOT_LOG").unwrap_or("off".to_string());
- if level == "none" {
+ if level == "off" {
return;
}
if let Ok(level) = LevelFilter::from_str(&level) {
simplelog::WriteLogger::init(
level,
simplelog::Config::default(),
- File::create("dev.log").unwrap(),
- ).unwrap();
+ File::create("dev.log").expect("Log file can't be created")
+ ).expect("log initialization failed");
info!("Starting B-Root with log level {}", level);
}
}
