allow the log level to be set via environment variable

This commit is contained in:
Gered 2023-07-01 14:34:18 -04:00
parent 276c714ee8
commit ee30a192c2

View file

@ -102,9 +102,10 @@ fn spawn_watcher(
#[actix_web::main] #[actix_web::main]
async fn main() -> anyhow::Result<()> { 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::new(
simple_log::LogConfigBuilder::builder() // simple_log::LogConfigBuilder::builder() //
.level("debug") .level(log_level)
.output_console() .output_console()
.build(), .build(),
) )