From b60a62d5f0e127787f9ad4a6af309a057beea2c3 Mon Sep 17 00:00:00 2001 From: Clement Tsang <34804052+ClementTsang@users.noreply.github.com> Date: Sat, 6 May 2023 12:56:01 -0400 Subject: [PATCH] other: keep running even if logger fails to initialize (#1132) This just makes it so that even if the logger is enabled, if it fails to initialize (e.g. read-only directory), bottom will still continue to start up, and just print a warning that the logger encountered an issue. --- src/bin/main.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/bin/main.rs b/src/bin/main.rs index 77709f5a..4332f759 100644 --- a/src/bin/main.rs +++ b/src/bin/main.rs @@ -47,7 +47,11 @@ fn main() -> Result<()> { let matches = clap::get_matches(); #[cfg(all(feature = "fern"))] { - utils::logging::init_logger(log::LevelFilter::Debug, std::ffi::OsStr::new("debug.log"))?; + if let Err(err) = + utils::logging::init_logger(log::LevelFilter::Debug, std::ffi::OsStr::new("debug.log")) + { + println!("Issue initializing logger: {err}"); + } } // Read from config file.