From d52723d5bcf8a45735f438d172bba33df6b460d2 Mon Sep 17 00:00:00 2001 From: whitequark Date: Tue, 7 Mar 2017 07:28:24 +0000 Subject: [PATCH] runtime: allow setting log level in configuration. --- artiq/firmware/runtime/lib.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/artiq/firmware/runtime/lib.rs b/artiq/firmware/runtime/lib.rs index a48df593a..a3c603c68 100644 --- a/artiq/firmware/runtime/lib.rs +++ b/artiq/firmware/runtime/lib.rs @@ -68,6 +68,15 @@ fn startup() { } info!("continuing boot"); + match config::read_str("log_level", |r| r?.parse()) { + Err(()) => (), + Ok(log_level_filter) => { + info!("log level set to {} in configuration", log_level_filter); + logger_artiq::BufferLogger::with_instance(|logger| + logger.set_max_log_level(log_level_filter)); + } + } + #[cfg(has_i2c)] board::i2c::init(); #[cfg(has_ad9516)]