diff options
author | Clement Tsang <34804052+ClementTsang@users.noreply.github.com> | 2023-05-06 12:56:01 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-06 12:56:01 -0400 |
commit | b60a62d5f0e127787f9ad4a6af309a057beea2c3 (patch) | |
tree | 2f4ad22608edfda0da88e7359f1fe2f5a161c30c | |
parent | 4cdedffaeee01190a054498dce21b5003496a71e (diff) |
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.
-rw-r--r-- | src/bin/main.rs | 6 |
1 files changed, 5 insertions, 1 deletions
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. |