Skip to content

Commit

Permalink
only set log_metadata_name on our special log
Browse files Browse the repository at this point in the history
  • Loading branch information
GoldsteinE committed Aug 25, 2023
1 parent 2d678bd commit 1fd3aa8
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions elfo-logger/src/filtering_layer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,15 +93,14 @@ impl<S: Subscriber> Layer<S> 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;
}
}
Expand Down

0 comments on commit 1fd3aa8

Please sign in to comment.