diff --git a/.changes/log-timezone_strategy-loglevel-fix.md b/.changes/log-timezone_strategy-loglevel-fix.md new file mode 100644 index 00000000..b3787e0d --- /dev/null +++ b/.changes/log-timezone_strategy-loglevel-fix.md @@ -0,0 +1,6 @@ +--- +"log": patch +"log-js": patch +--- + +Fix timezone_strategy overwriting previously set LogLevels. diff --git a/plugins/log/src/lib.rs b/plugins/log/src/lib.rs index e7848ff4..9f9a4adf 100644 --- a/plugins/log/src/lib.rs +++ b/plugins/log/src/lib.rs @@ -278,7 +278,7 @@ impl Builder { let format = time::format_description::parse("[[[year]-[month]-[day]][[[hour]:[minute]:[second]]") .unwrap(); - self.dispatch = fern::Dispatch::new().format(move |out, message, record| { + self.dispatch = self.dispatch.format(move |out, message, record| { out.finish(format_args!( "{}[{}][{}] {}", timezone_strategy.get_now().format(&format).unwrap(),