Function tracing::collect::with_default[][src]

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

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

The default collector is used when creating a new Span or Event, if no span is currently executing. If a span is currently executing, new spans or events are dispatched to the collector that tagged that span, instead.