Skip to main content

try_init

Function try_init 

Source
pub fn try_init(
    filter: EnvFilter,
    format: LogFormat,
    redactor: Redactor,
) -> Result<(), TryInitError>
Expand description

Try to initialize tracing with AFDATA output.

Returns Err if a global tracing subscriber is already initialized. This is the single entry point for tracing initialization; pass your desired format and redactor configuration.

ยงArguments

  • filter - tracing_subscriber::EnvFilter controlling which events are recorded
  • format - LogFormat::Json, LogFormat::Plain, or LogFormat::Yaml
  • redactor - Redactor with optional custom secret field names and policy