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

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"));