logo

Function tracing::subscriber::set_global_default[][src]

pub fn set_global_default<S>(subscriber: S) -> Result<(), SetGlobalDefaultError> where
    S: Subscriber + Send + Sync + 'static, 
Expand description

Sets this subscriber as the global default for the duration of the entire program. Will be used as a fallback if no thread-local subscriber has been set in a thread (using with_default.)

Can only be set once; subsequent attempts to set the global default will fail. Returns whether the initialization was successful.

Note: Libraries should NOT call set_global_default()! That will cause conflicts when executables try to set them later.