Skip to content

Commit

Permalink
Keep stdio when daemonizing, reduce some log levels
Browse files Browse the repository at this point in the history
  • Loading branch information
jackpot51 committed Nov 27, 2023
1 parent ced0845 commit 3b82540
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,15 @@ lazy_static::lazy_static! {
}

fn main() -> Result<(), Box<dyn std::error::Error>> {
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) => {
eprintln!("failed to daemonize: {:?}", err);
process::exit(1);
}
}

env_logger::Builder::from_env(env_logger::Env::default().default_filter_or("warn")).init();

localize::localize();
Expand All @@ -78,7 +78,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
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
}
};
Expand Down Expand Up @@ -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)
}
}),
Expand All @@ -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)
}
}),
Expand Down

0 comments on commit 3b82540

Please sign in to comment.