pub struct IndicatifFilter<S> { /* private fields */ }
Expand description
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.
The value for this field is irrelevant and not factored in to the filtering (this is due to
tracing not making field values available in the on_new_span
method). To avoid confusion, it
is recommended to set the value of this field to tracing::field::Empty
.
If both “indicatif.pb_show” and “indicatif.pb_hide” are present, the behavior is to show a progress bar.
Implementations§
Source§impl<S: Subscriber> IndicatifFilter<S>
impl<S: Subscriber> IndicatifFilter<S>
Sourcepub fn new(show_progress_bars_by_default: bool) -> Self
pub fn new(show_progress_bars_by_default: bool) -> Self
Constructs the filter.
If “indicatif.pb_show” or “indicatif.pb_hide” are not present as a field on the span,
then the value of show_progress_bars_by_default
is used; i.e. if
show_progress_bars_by_default
is false
, then progress bars are not shown for spans by
default.
Trait Implementations§
Source§impl<S: Subscriber> Filter<S> for IndicatifFilter<S>
impl<S: Subscriber> Filter<S> for IndicatifFilter<S>
Source§fn enabled(&self, meta: &Metadata<'_>, _: &Context<'_, S>) -> bool
fn enabled(&self, meta: &Metadata<'_>, _: &Context<'_, S>) -> bool
true
if this layer is interested in a span or event with the
given Metadata
in the current Context
, similarly to
Subscriber::enabled
. Read moreSource§fn callsite_enabled(&self, meta: &'static Metadata<'static>) -> Interest
fn callsite_enabled(&self, meta: &'static Metadata<'static>) -> Interest
Source§fn event_enabled(&self, event: &Event<'_>, cx: &Context<'_, S>) -> bool
fn event_enabled(&self, event: &Event<'_>, cx: &Context<'_, S>) -> bool
Layer]'s [
on_event], to determine if
on_event` should be called. Read more