logo

Function tracing::subscriber::with_default[][src]

pub fn with_default<T, S>(subscriber: S, f: impl FnOnce() -> T) -> T where
    S: Subscriber + Send + Sync + 'static, 
Expand description

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

The default subscriber 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 subscriber that tagged that span, instead.