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.
This commit is contained in:
Clement Tsang 2023-05-06 12:56:01 -04:00 committed by GitHub
parent 4cdedffaee
commit b60a62d5f0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -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.