summaryrefslogtreecommitdiffstats
path: root/lib/core/libimagrt
diff options
context:
space:
mode:
authorMatthias Beyer <mail@beyermatthias.de>2019-02-19 21:19:34 +0100
committerMatthias Beyer <mail@beyermatthias.de>2019-02-19 21:51:44 +0100
commit22c239c21282e1b206db5624fca23aaa02d873b6 (patch)
treed2010540348a42fd29ea4e274da541fef45b7635 /lib/core/libimagrt
parent6681f9fcfd520c67af6ac719647e4c0b36b6f7f8 (diff)
Add output about logger settings in logging setup
This way we can get trace-level information about the logger itself when it is generated. Because from time to time we might want to have a look at that. Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Diffstat (limited to 'lib/core/libimagrt')
-rw-r--r--lib/core/libimagrt/src/logger.rs3
-rw-r--r--lib/core/libimagrt/src/runtime.rs6
2 files changed, 8 insertions, 1 deletions
diff --git a/lib/core/libimagrt/src/logger.rs b/lib/core/libimagrt/src/logger.rs
index fa6c8c28..585f2855 100644
--- a/lib/core/libimagrt/src/logger.rs
+++ b/lib/core/libimagrt/src/logger.rs
@@ -41,6 +41,7 @@ use libimagerror::errors::ErrorMsg as EM;
type ModuleName = String;
+#[derive(Debug)]
enum LogDestination {
Stderr,
File(Arc<Mutex<::std::fs::File>>),
@@ -52,6 +53,7 @@ impl Default for LogDestination {
}
}
+#[derive(Debug)]
struct ModuleSettings {
enabled: bool,
level: Option<Level>,
@@ -61,6 +63,7 @@ struct ModuleSettings {
}
/// Logger implementation for `log` crate.
+#[derive(Debug)]
pub struct ImagLogger {
global_loglevel : Level,
diff --git a/lib/core/libimagrt/src/runtime.rs b/lib/core/libimagrt/src/runtime.rs
index 4f2a485f..a5071745 100644
--- a/lib/core/libimagrt/src/runtime.rs
+++ b/lib/core/libimagrt/src/runtime.rs
@@ -367,11 +367,15 @@ impl<'a> Runtime<'a> {
set_max_level(logger.global_loglevel().to_level_filter());
- debug!("Init logger with {}", logger.global_loglevel());
+ // safe debug output for later, after the instance itself
+ // is moved away
+ let logger_expl = format!("{:?}", logger);
set_boxed_logger(Box::new(logger))
.map_err(|e| panic!("Could not setup logger: {:?}", e))
.ok();
+
+ trace!("Imag Logger = {}", logger_expl);
}
}