From 45dba38513c15bbe767e7a0d497843fd2daa4f01 Mon Sep 17 00:00:00 2001 From: Dominik Gschwind Date: Sat, 5 Aug 2023 21:45:56 +0200 Subject: [PATCH] Set default log level to info on release build --- src/main.rs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index fba3e2f..acc7fcb 100644 --- a/src/main.rs +++ b/src/main.rs @@ -96,7 +96,16 @@ fn check_cfg_exists(p: PathBuf) -> Result { #[tokio::main(flavor = "current_thread")] async fn main() -> anyhow::Result<()> { let args = Args::parse(); - simple_logger::init_with_env()?; + simple_logger::SimpleLogger::new() + .with_level( + #[cfg(debug_assertions)] + log::LevelFilter::Debug, + #[cfg(not(debug_assertions))] + log::LevelFilter::Info, + ) + .env() + .init() + .unwrap(); // Figure out the config path to use. let config_path = match args.config {