Skip to content

Commit

Permalink
Add a public current_span() method for FmtContext
Browse files Browse the repository at this point in the history
  • Loading branch information
Folyd committed Mar 10, 2021
1 parent fe59f77 commit fb3c3c7
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tracing-subscriber/src/fmt/fmt_subscriber.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use std::{
};
use tracing_core::{
field,
span::{Attributes, Id, Record},
span::{Attributes, Current, Id, Record},
Collect, Event, Metadata,
};

Expand Down Expand Up @@ -832,6 +832,11 @@ where
self.ctx.scope()
}

/// Returns the current span for this formatter.
pub fn current_span(&self) -> Current {
self.ctx.current_span()
}

/// Returns the [field formatter] configured by the subscriber invoking
/// `format_event`.
///
Expand Down

0 comments on commit fb3c3c7

Please sign in to comment.