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 subscriber 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
Event
s.
This is shorthand for
tracing_subscriber::fmt().try_init()
ยงErrors
Returns an Error if the initialization was unsuccessful,
likely because a global subscriber was already installed by another
call to try_init
.