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 convenience entry point for a global subscriber. Use AfdataLayer::new directly when composing a subscriber, injecting a writer, or retaining a StructuredLogHandle.

ยง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