logger: Limit std-log level

This commit is contained in:
Victoria Brekenfeld 2023-01-09 13:53:00 +01:00
parent 8a2e1e5c89
commit 08c6e3f209
3 changed files with 8 additions and 1 deletions

1
Cargo.lock generated
View file

@ -334,6 +334,7 @@ dependencies = [
"indexmap",
"lazy_static",
"libsystemd 0.5.0",
"log",
"log-panics",
"png",
"regex",

View file

@ -14,6 +14,7 @@ slog-async = "2.7"
slog-journald = "2.2.0"
slog-scope = "4.4"
slog-stdlog = "4.1"
log = "0.4"
serde = { version = "1", features = ["derive"] }
serde_json = "1"
sendfd = "0.4.1"

View file

@ -19,7 +19,12 @@ pub fn init_logger() -> Result<LogState> {
let logger = slog::Logger::root(std::sync::Mutex::new(drain).fuse(), slog::o!());
let _guard = slog_scope::set_global_logger(logger);
slog_stdlog::init().unwrap();
slog_stdlog::init_with_level(if cfg!(debug_assertions) {
log::Level::Debug
} else {
log::Level::Info
})
.unwrap();
log_panics::init();
slog_scope::info!("Version: {}", std::env!("CARGO_PKG_VERSION"));