Initialize the logger at the start of main.

"Any log events that occur before initialization will be ignored."
https://docs.rs/env_logger/latest/env_logger/struct.Builder.html#method.init
This commit is contained in:
Dominic Gerhauser 2025-04-11 00:07:55 +02:00 committed by Jeremy Soller
parent e7b0b87259
commit 623645c829

View file

@ -80,6 +80,8 @@ pub fn icon_cache_get(name: &'static str, size: u16) -> widget::icon::Icon {
/// Runs application with these settings
fn main() -> Result<(), Box<dyn std::error::Error>> {
env_logger::Builder::from_env(env_logger::Env::default().default_filter_or("warn")).init();
let mut daemonize = true;
let mut args_iter = env::args().fuse();
// more performant than an iterator adapter
@ -114,8 +116,6 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
}
}
env_logger::Builder::from_env(env_logger::Env::default().default_filter_or("warn")).init();
localize::localize();
let (config_handler, config) = match cosmic_config::Config::new(App::APP_ID, CONFIG_VERSION) {