Skip to content

Commit 8692bc5

Browse files
committed
Add a public context() method for FmtContext
1 parent fe59f77 commit 8692bc5

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

tracing-subscriber/src/fmt/fmt_subscriber.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -842,6 +842,11 @@ where
842842
pub fn field_format(&self) -> &N {
843843
self.fmt_fields
844844
}
845+
846+
/// Returns the current span [`Context`] for this formatter.
847+
pub fn context(&self) -> &Context<'_, S> {
848+
&self.ctx
849+
}
845850
}
846851

847852
struct Timings {

0 commit comments

Comments
 (0)