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

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

Function tracing_subscriber::fmt::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.