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

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

tracing_subscriber::fmt

Function try_init

Source
pub fn try_init() -> Result<(), Box<dyn Error + Send + Sync + 'static>>
Available on crate features fmt and std only.
Expand description

Install a global tracing collector that listens for events and filters based on the value of the RUST_LOG environment variable, if one is not already set.

If the tracing-log feature is enabled, this will also install the LogTracer to convert log records into tracing Events.

This is shorthand for

tracing_subscriber::fmt().try_init()

ยงErrors

Returns an Error if the initialization was unsuccessful, likely because a global collector was already installed by another call to try_init.