From 66d4a3ecaba15af4ce56318d62ac9e7b666ead83 Mon Sep 17 00:00:00 2001 From: desbma-s1n Date: Wed, 29 May 2024 18:10:11 +0200 Subject: [PATCH] feat: more flexible log level --- src/main.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index b4739b7..cfc60bd 100644 --- a/src/main.rs +++ b/src/main.rs @@ -35,8 +35,14 @@ fn sd_options( fn main() -> anyhow::Result<()> { // Init logger simple_logger::SimpleLogger::new() + .with_level(if cfg!(debug_assertions) { + log::LevelFilter::Debug + } else { + log::LevelFilter::Info + }) + .env() .init() - .context("Failed to init logger")?; + .context("Failed to setup logger")?; // Get versions let sd_version = systemd::SystemdVersion::local_system()?;