From 1fd3aa80c4badc6818a8ef9c95e730a8917f223a Mon Sep 17 00:00:00 2001 From: Goldstein Date: Fri, 25 Aug 2023 11:26:39 +0300 Subject: [PATCH] only set log_metadata_name on our special log --- elfo-logger/src/filtering_layer.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/elfo-logger/src/filtering_layer.rs b/elfo-logger/src/filtering_layer.rs index 1f27754e..18ec3579 100644 --- a/elfo-logger/src/filtering_layer.rs +++ b/elfo-logger/src/filtering_layer.rs @@ -93,15 +93,14 @@ impl Layer for FilteringLayer { } } } else if name == "log record" { - // That's the first record from `tracing-log`. - self.inner.log_metadata_name.set(name).ok(); let config = self.inner.config.load(); if !config.targets.would_enable(meta.target(), meta.level()) { return false; } - // That's `Initialized tracing_log adapter` to set `log_metadata_name`, just + // That's "initialized tracing_log adapter" to set `log_metadata_name`, just // ignore it. Any actual logs from `elfo_logger` would use `tracing`. if meta.module_path() == Some("elfo_logger") { + self.inner.log_metadata_name.set(name).ok(); return false; } }