Skip to content

Commit

Permalink
[log] fix errors
Browse files Browse the repository at this point in the history
  • Loading branch information
auguwu committed Jan 13, 2024
1 parent 773884d commit 12063d1
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions crates/log/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,12 +105,13 @@ impl<S: Subscriber + for<'l> LookupSpan<'l>> Layer<S> for WriteLayer {

fn on_event(&self, event: &Event<'_>, ctx: tracing_subscriber::layer::Context<'_, S>) {
#[cfg(feature = "log")]
let metadata = {
use tracing_log::NormalizeEvent;
use tracing_log::NormalizeEvent;

let mt = event.normalized_metadata();
mt.as_ref().unwrap_or_else(|| event.metadata());
};
#[cfg(feature = "log")]
let metadata = event.normalized_metadata();

#[cfg(feature = "log")]
let metadata = metadata.as_ref().unwrap_or_else(|| event.metadata());

#[cfg(not(feature = "log"))]
let metadata = event.metadata();
Expand Down

0 comments on commit 12063d1

Please sign in to comment.