From ee30a192c232de49ae6442f07e893a973bd30777 Mon Sep 17 00:00:00 2001 From: gered Date: Sat, 1 Jul 2023 14:34:18 -0400 Subject: [PATCH] allow the log level to be set via environment variable --- src/main.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index ba9a058..5b45fb7 100644 --- a/src/main.rs +++ b/src/main.rs @@ -102,9 +102,10 @@ fn spawn_watcher( #[actix_web::main] async fn main() -> anyhow::Result<()> { + let log_level = env::var("LOG_LEVEL").map_or(String::from("info"), |value| value.to_lowercase()); simple_log::new( simple_log::LogConfigBuilder::builder() // - .level("debug") + .level(log_level) .output_console() .build(), )