Skip to main content

record_layer_with_failure_and_ansi

Function record_layer_with_failure_and_ansi 

Source
pub fn record_layer_with_failure_and_ansi<Registry, Sink>(
    limits: FormatterLimits,
    sink: Sink,
    failure: impl Fn() + Send + Sync + 'static,
    ansi: bool,
) -> (impl Layer<Registry> + Send + Sync, RecordStatus)
where Registry: Subscriber + for<'lookup> LookupSpan<'lookup>, Sink: Fn(&[u8]) -> Result<()> + Send + Sync + 'static,
Expand description

Prepare a complete-record layer with an explicit ANSI formatting policy.

ansi is resolved by the host caller before constructing the layer, never by inspecting terminal state while formatting. true matches stock Full styling; false preserves record_layer_with_failure’s default bytes. Both event and span limits count all emitted bytes, including escape codes. The filtering, failure and completion requirements of that constructor still apply. This option does not install a layer or change CLI output.