From 70505f2078c0d55f0e805a9bb00a731120c997a7 Mon Sep 17 00:00:00 2001 From: ElnuDev Date: Sat, 26 Aug 2023 12:12:43 -0700 Subject: [PATCH] Fix logging initialization --- status_cloud/src/main.rs | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/status_cloud/src/main.rs b/status_cloud/src/main.rs index e92f08f..7a49987 100644 --- a/status_cloud/src/main.rs +++ b/status_cloud/src/main.rs @@ -7,17 +7,13 @@ use std::{process::Command, path::PathBuf}; fn main() -> Result<(), Box> { let args = CliArgs::parse(); - if args.debug { - let _ = simplelog::SimpleLogger::init( - simplelog::LevelFilter::Debug, - simplelog::Config::default(), - ); - } else { - let _ = simplelog::SimpleLogger::init( - simplelog::LevelFilter::Info, - simplelog::Config::default(), - ); - } + simplelog::SimpleLogger::init( + match args.debug { + true => simplelog::LevelFilter::Debug, + false => simplelog::LevelFilter::Info, + }, + simplelog::Config::default(), + )?; debug!("Opening Config file: {}", args.config_file.display()); debug!(