From 3b8254020fad9a92265a6c1acbd54c1d3c1a63df Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Mon, 27 Nov 2023 14:52:39 -0700 Subject: [PATCH] Keep stdio when daemonizing, reduce some log levels --- src/main.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main.rs b/src/main.rs index 27d49bd..fda67fe 100644 --- a/src/main.rs +++ b/src/main.rs @@ -60,7 +60,7 @@ lazy_static::lazy_static! { } fn main() -> Result<(), Box> { - match fork::daemon(false, false) { + match fork::daemon(true, true) { Ok(fork::Fork::Child) => (), Ok(fork::Fork::Parent(_child_pid)) => process::exit(0), Err(err) => { @@ -68,7 +68,7 @@ fn main() -> Result<(), Box> { process::exit(1); } } - + env_logger::Builder::from_env(env_logger::Env::default().default_filter_or("warn")).init(); localize::localize(); @@ -78,7 +78,7 @@ fn main() -> Result<(), Box> { let config = match Config::get_entry(&config_handler) { Ok(ok) => ok, Err((errs, config)) => { - log::warn!("errors loading config: {:?}", errs); + log::info!("errors loading config: {:?}", errs); config } }; @@ -1303,7 +1303,7 @@ impl Application for App { .map(|(_, res)| match res { Ok(config) => Message::Config(config), Err((errs, config)) => { - log::warn!("errors loading config: {:#?}", errs); + log::info!("errors loading config: {:?}", errs); Message::Config(config) } }), @@ -1315,7 +1315,7 @@ impl Application for App { .map(|(_, u)| match u { Ok(t) => Message::SystemThemeModeChange(t), Err((errs, t)) => { - log::warn!("errors loading theme mode: {:#?}", errs); + log::info!("errors loading theme mode: {:?}", errs); Message::SystemThemeModeChange(t) } }),