🛈 Note: This is pre-release documentation for the upcoming tracing 0.2.0 ecosystem.

For the release documentation, please see docs.rs, instead.

tracing::collect

Function with_default

source
pub fn with_default<T, C>(collector: C, f: impl FnOnce() -> T) -> T
where C: Collect + Send + Sync + 'static,
Available on crate feature std only.
Expand description

Sets this collector as the default for the current thread for the duration of a closure.

The default collector is used when creating a new Span or Event.