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

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

pub fn with_default<T>(dispatcher: &Dispatch, f: impl FnOnce() -> T) -> T
Available on crate feature std only.
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.

Note: This function required the Rust standard library.

no_std users should use set_global_default instead.