Function tracing_subscriber::fmt::try_init
source · pub fn try_init() -> Result<(), Box<dyn Error + Send + Sync + 'static>>
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
.