Fix logging initialization

This commit is contained in:
Elnu 2023-08-26 12:12:43 -07:00
parent 5d64a8ed1f
commit 70505f2078

View file

@ -7,17 +7,13 @@ use std::{process::Command, path::PathBuf};
fn main() -> Result<(), Box<dyn std::error::Error>> { fn main() -> Result<(), Box<dyn std::error::Error>> {
let args = CliArgs::parse(); let args = CliArgs::parse();
if args.debug { simplelog::SimpleLogger::init(
let _ = simplelog::SimpleLogger::init( match args.debug {
simplelog::LevelFilter::Debug, true => simplelog::LevelFilter::Debug,
simplelog::Config::default(), false => simplelog::LevelFilter::Info,
); },
} else { simplelog::Config::default(),
let _ = simplelog::SimpleLogger::init( )?;
simplelog::LevelFilter::Info,
simplelog::Config::default(),
);
}
debug!("Opening Config file: {}", args.config_file.display()); debug!("Opening Config file: {}", args.config_file.display());
debug!( debug!(