Function init_logger_with_additional_layer

Source
pub fn init_logger_with_additional_layer<F, T>(
    early_dcx: &EarlyDiagCtxt,
    cfg: LoggerConfig,
    build_subscriber: F,
)
where F: FnOnce() -> T, T: BuildSubscriberRet,
Expand description

This allows tools to enable rust logging without having to magically match rustc’s tracing crate version. In contrast to init_rustc_env_logger, it allows you to choose the logger config directly rather than having to set an environment variable. Moreover, in contrast to init_logger, it allows you to add a custom tracing layer via build_subscriber, for example || Registry::default().with(custom_layer).