read config from args

This commit is contained in:
Christopher Moyer 2024-12-17 23:58:22 -05:00
parent bf1ee8efe8
commit 2b326c765d

View file

@ -31,8 +31,7 @@ ____ __ ____ __ __ __ _______..______ _______ .______
"#; "#;
println!("{ascii}"); println!("{ascii}");
let args: Vec<String> = env::args().collect(); let args: Vec<String> = env::args().collect();
// let cfg: AppConfig = confy::load_path(Path::new(&args[1])).expect("Couldn't read config"); let cfg: AppConfig = confy::load_path(Path::new(&args[1])).expect("Couldn't read config");
let cfg: AppConfig = confy::load_path("./config.toml").expect("Couldn't read config");
match Path::new("log4rs.yaml").exists() { match Path::new("log4rs.yaml").exists() {
true => log4rs::init_file("log4rs.yaml", Default::default()).unwrap(), true => log4rs::init_file("log4rs.yaml", Default::default()).unwrap(),
false => println!("No log4rs.yaml file found. Logging will not be enabled") false => println!("No log4rs.yaml file found. Logging will not be enabled")