pub fn init(config: &Config) -> Result<TracingGuard>Expand description
Initialise the global tracing subscriber.
Reads the log level from RUST_LOG if set; falls back to
Config::level otherwise. Selects the output format from
Config::format.
When the sentry feature is enabled and a non-empty DSN is supplied,
the Sentry SDK is also initialised and wired to the tracing subscriber
via sentry-tracing.
Returns a TracingGuard that must be kept alive for the duration of
the process. Dropping it flushes any buffered Sentry events.
Calling this function more than once in the same process is harmless —
subsequent calls attempt try_init and silently ignore the
“already initialised” error.
§Errors
Currently infallible. The Result return type is reserved for future
validation of the Config fields at initialisation time.