Skip to main content

init_logging_with_layer

Function init_logging_with_layer 

Source
pub fn init_logging_with_layer<L>(
    config: &LogConfig,
    layer: L,
) -> Result<LoggingGuards>
where L: Layer<Registry> + Send + Sync + 'static,
Expand description

Initialize logging with an independently filtered event or span layer.

The diagnostic EnvFilter applies only to formatted logs. The caller must apply any desired filtering to layer itself. Returns an error if another global subscriber is already installed: success means this layer was attached.