tracing_indicatif

Module filter

source
Expand description

Provides a rudimentary filter layer that can be used to selectively enable progress bars on a per-span level.

§Example Use

use tracing_subscriber::layer::SubscriberExt;
use tracing_subscriber::util::SubscriberInitExt;
use tracing_indicatif::IndicatifLayer;
use tracing_indicatif::filter::IndicatifFilter;
use tracing_indicatif::filter::hide_indicatif_span_fields;
use tracing_subscriber::fmt::format::DefaultFields;
use tracing_subscriber::layer::Layer;

let indicatif_layer = IndicatifLayer::new()
    .with_span_field_formatter(hide_indicatif_span_fields(DefaultFields::new()));

tracing_subscriber::registry()
    .with(tracing_subscriber::fmt::layer().with_writer(indicatif_layer.get_stderr_writer()))
    .with(indicatif_layer.with_filter(IndicatifFilter::new(false)))
    .init();

Structs§

  • A filter that filters based on the presence of a field with the name of either “indicatif.pb_show” or “indicatif.pb_hide” on the span.

Functions§