pub fn init()
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.
The configuration of the subscriber initialized by this function depends on what feature flags are enabled.
If the tracing-log
feature is enabled, this will also install
the LogTracer to convert Log
records into tracing
Event
s.
If the env-filter
feature is enabled, this is shorthand for
tracing_subscriber::fmt()
.with_env_filter(EnvFilter::from_default_env())
.init();
ยงPanics
Panics if the initialization was unsuccessful, likely because a
global subscriber was already installed by another call to try_init
.