tokio_trace::subscriber

Function with_default

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

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

The default dispatcher 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.