Skip to main content

init_subscriber

Function init_subscriber 

Source
pub fn init_subscriber(subscriber: impl Subscriber + Send + Sync)
Expand description

Initializes the global default tracing subscriber.

This function sets the provided subscriber as the global default for processing tracing spans and events. It also redirects log crate events to this subscriber.

§Arguments

  • subscriber - An impl Subscriber + Send + Sync which will be set as the global default.

§Panics

Panics if unable to set the global logger or subscriber, typically indicating that a subscriber has already been set.