diff --git a/src/lib.rs b/src/lib.rs index e7ed7e6..f3d9ac4 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -26,7 +26,7 @@ pub trait AppConfig: Sized + Serialize + DeserializeOwned + Debug + Default { } /// Get log module levels to use (take priority over the main log level) - fn logging_mod_levels(&self) -> Option> { + fn logging_mod_levels(&self) -> Option<&HashMap> { None } @@ -180,8 +180,8 @@ pub trait AppConfig: Sized + Serialize + DeserializeOwned + Debug + Default { if let Some(mod_levels) = config.logging_mod_levels() { for (module, lvl) in mod_levels { - let lvl = log::LevelFilter::from_str(lvl.as_ref())?; - builder.filter_module(module.as_ref(), lvl); + let lvl = log::LevelFilter::from_str(lvl)?; + builder.filter_module(module, lvl); } }