From c110d98959dfa55669e6276639c458b9f9129f24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20Wo=C5=BAniak?= Date: Wed, 4 Aug 2021 16:00:28 +0200 Subject: [PATCH] Set default log level and initialize logger before load config --- src/main.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index 5c8f7b1..0c60e9f 100644 --- a/src/main.rs +++ b/src/main.rs @@ -218,8 +218,7 @@ fn main() -> std::io::Result<()> { } let config = load_config()?; - - std::env::set_var("RUST_LOG", config.log_level().to_str()); + log::set_max_level(config.log_level().to_str().parse().unwrap()); let opts: Opts = Opts::parse_args_default_or_exit();