Struct tracing_subscriber::filter::LevelFilter
source · [−]#[repr(transparent)]pub struct LevelFilter(_);Expand description
A filter comparable to a verbosity Level.
If a Level is considered less than a LevelFilter, it should be
considered disabled; if greater than or equal to the LevelFilter, that
level is enabled.
Note that this is essentially identical to the Level type, but with the
addition of an OFF level that completely disables all trace
instrumentation.
See the documentation for the Level type for more details.
Implementations
The “off” level.
Designates that trace instrumentation should be completely disabled.
The “error” level.
Designates very serious errors.
The “warn” level.
Designates hazardous situations.
The “info” level.
Designates useful information.
The “debug” level.
Designates lower priority information.
The “trace” level.
Designates very low priority, often extremely verbose, information.
pub const fn from_level(level: Level) -> LevelFilterⓘNotable traits for LevelFilterimpl<S> Filter<S> for LevelFilterimpl<S: Subscriber> Layer<S> for LevelFilter
pub const fn from_level(level: Level) -> LevelFilterⓘNotable traits for LevelFilterimpl<S> Filter<S> for LevelFilterimpl<S: Subscriber> Layer<S> for LevelFilter
impl<S> Filter<S> for LevelFilterimpl<S: Subscriber> Layer<S> for LevelFilterReturns a LevelFilter that enables spans and events with verbosity up
to and including level.
pub const fn into_level(self) -> Option<Level>ⓘNotable traits for Option<L>impl<L, S> Layer<S> for Option<L> where
L: Layer<S>,
S: Subscriber,
pub const fn into_level(self) -> Option<Level>ⓘNotable traits for Option<L>impl<L, S> Layer<S> for Option<L> where
L: Layer<S>,
S: Subscriber,
impl<L, S> Layer<S> for Option<L> where
L: Layer<S>,
S: Subscriber, pub fn current() -> LevelFilterⓘNotable traits for LevelFilterimpl<S> Filter<S> for LevelFilterimpl<S: Subscriber> Layer<S> for LevelFilter
pub fn current() -> LevelFilterⓘNotable traits for LevelFilterimpl<S> Filter<S> for LevelFilterimpl<S: Subscriber> Layer<S> for LevelFilter
impl<S> Filter<S> for LevelFilterimpl<S: Subscriber> Layer<S> for LevelFilterReturns a LevelFilter that matches the most verbose Level that any
currently active Subscriber will enable.
User code should treat this as a hint. If a given span or event has a
level higher than the returned LevelFilter, it will not be enabled.
However, if the level is less than or equal to this value, the span or
event is not guaranteed to be enabled; the subscriber will still
filter each callsite individually.
Therefore, comparing a given span or event’s level to the returned
LevelFilter can be used for determining if something is
disabled, but should not be used for determining if something is
enabled.`
Trait Implementations
type Log = LevelFilter
type Log = LevelFilter
The log type that this type can be converted into.
pub fn as_log(&self) -> <LevelFilter as AsLog>::LogⓘNotable traits for LevelFilterimpl<S> Filter<S> for LevelFilterimpl<S: Subscriber> Layer<S> for LevelFilter
pub fn as_log(&self) -> <LevelFilter as AsLog>::LogⓘNotable traits for LevelFilterimpl<S> Filter<S> for LevelFilterimpl<S: Subscriber> Layer<S> for LevelFilter
impl<S> Filter<S> for LevelFilterimpl<S: Subscriber> Layer<S> for LevelFilterReturns the log equivalent of self.
pub fn clone(&self) -> LevelFilterⓘNotable traits for LevelFilterimpl<S> Filter<S> for LevelFilterimpl<S: Subscriber> Layer<S> for LevelFilter
pub fn clone(&self) -> LevelFilterⓘNotable traits for LevelFilterimpl<S> Filter<S> for LevelFilterimpl<S: Subscriber> Layer<S> for LevelFilter
impl<S> Filter<S> for LevelFilterimpl<S: Subscriber> Layer<S> for LevelFilterReturns a copy of the value. Read more
Performs copy-assignment from source. Read more
Returns true if this layer is interested in a span or event with the
given Metadata in the current Context, similarly to
Subscriber::enabled. Read more
fn max_level_hint(&self) -> Option<LevelFilter>ⓘNotable traits for Option<L>impl<L, S> Layer<S> for Option<L> where
L: Layer<S>,
S: Subscriber,
fn max_level_hint(&self) -> Option<LevelFilter>ⓘNotable traits for Option<L>impl<L, S> Layer<S> for Option<L> where
L: Layer<S>,
S: Subscriber,
impl<L, S> Layer<S> for Option<L> where
L: Layer<S>,
S: Subscriber, Returns an optional hint of the highest verbosity level that
this Filter will enable. Read more
pub fn from(level: Level) -> LevelFilterⓘNotable traits for LevelFilterimpl<S> Filter<S> for LevelFilterimpl<S: Subscriber> Layer<S> for LevelFilter
pub fn from(level: Level) -> LevelFilterⓘNotable traits for LevelFilterimpl<S> Filter<S> for LevelFilterimpl<S: Subscriber> Layer<S> for LevelFilter
impl<S> Filter<S> for LevelFilterimpl<S: Subscriber> Layer<S> for LevelFilterPerforms the conversion.
Performs the conversion.
pub fn from(level: Option<Level>) -> LevelFilterⓘNotable traits for LevelFilterimpl<S> Filter<S> for LevelFilterimpl<S: Subscriber> Layer<S> for LevelFilter
pub fn from(level: Option<Level>) -> LevelFilterⓘNotable traits for LevelFilterimpl<S> Filter<S> for LevelFilterimpl<S: Subscriber> Layer<S> for LevelFilter
impl<S> Filter<S> for LevelFilterimpl<S: Subscriber> Layer<S> for LevelFilterPerforms the conversion.
type Err = ParseLevelFilterError
type Err = ParseLevelFilterError
The associated error which can be returned from parsing.
Parses a string s to return a value of this type. Read more
Registers a new callsite with this layer, returning whether or not
the layer is interested in being notified about the callsite, similarly
to Subscriber::register_callsite. Read more
Returns true if this layer is interested in a span or event with the
given metadata in the current Context, similarly to
Subscriber::enabled. Read more
Performs late initialization when attaching a Layer to a
Subscriber. Read more
Notifies this layer that a new span was constructed with the given
Attributes and Id. Read more
Notifies this layer that a span with the given Id recorded the given
values. Read more
Notifies this layer that a span with the ID span recorded that it
follows from the span with the ID follows. Read more
Notifies this layer that an event has occurred.
Notifies this layer that a span with the given ID was entered.
Notifies this layer that the span with the given ID was exited.
Notifies this layer that the span with the given ID has been closed.
Notifies this layer that a span ID has been cloned, and that the subscriber returned a different ID. Read more
Composes this layer around the given Layer, returning a Layered
struct implementing Layer. Read more
fn with_subscriber(self, inner: S) -> Layered<Self, S>ⓘ where
Self: Sized,
fn with_subscriber(self, inner: S) -> Layered<Self, S>ⓘ where
Self: Sized,
Composes this Layer with the given Subscriber, returning a
Layered struct that implements Subscriber. Read more
fn with_filter<F>(self, filter: F) -> Filtered<Self, F, S>ⓘNotable traits for Filtered<L, F, S>impl<S, L, F> Layer<S> for Filtered<L, F, S> where
S: Subscriber + for<'span> LookupSpan<'span> + 'static,
F: Filter<S> + 'static,
L: Layer<S>, where
Self: Sized,
F: Filter<S>,
fn with_filter<F>(self, filter: F) -> Filtered<Self, F, S>ⓘNotable traits for Filtered<L, F, S>impl<S, L, F> Layer<S> for Filtered<L, F, S> where
S: Subscriber + for<'span> LookupSpan<'span> + 'static,
F: Filter<S> + 'static,
L: Layer<S>, where
Self: Sized,
F: Filter<S>,
impl<S, L, F> Layer<S> for Filtered<L, F, S> where
S: Subscriber + for<'span> LookupSpan<'span> + 'static,
F: Filter<S> + 'static,
L: Layer<S>, registry and std only.This method tests for self and other values to be equal, and is used
by ==. Read more
This method tests for !=.
pub fn partial_cmp(&self, other: &Level) -> Option<Ordering>ⓘNotable traits for Option<L>impl<L, S> Layer<S> for Option<L> where
L: Layer<S>,
S: Subscriber,
pub fn partial_cmp(&self, other: &Level) -> Option<Ordering>ⓘNotable traits for Option<L>impl<L, S> Layer<S> for Option<L> where
L: Layer<S>,
S: Subscriber,
impl<L, S> Layer<S> for Option<L> where
L: Layer<S>,
S: Subscriber, This method returns an ordering between self and other values if one exists. Read more
This method tests less than (for self and other) and is used by the < operator. Read more
This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
This method tests greater than (for self and other) and is used by the > operator. Read more
pub fn partial_cmp(&self, other: &LevelFilter) -> Option<Ordering>ⓘNotable traits for Option<L>impl<L, S> Layer<S> for Option<L> where
L: Layer<S>,
S: Subscriber,
pub fn partial_cmp(&self, other: &LevelFilter) -> Option<Ordering>ⓘNotable traits for Option<L>impl<L, S> Layer<S> for Option<L> where
L: Layer<S>,
S: Subscriber,
impl<L, S> Layer<S> for Option<L> where
L: Layer<S>,
S: Subscriber, This method returns an ordering between self and other values if one exists. Read more
This method tests less than (for self and other) and is used by the < operator. Read more
This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
This method tests greater than (for self and other) and is used by the > operator. Read more
This method tests greater than or equal to (for self and other) and is used by the >=
operator. Read more
Auto Trait Implementations
impl RefUnwindSafe for LevelFilter
impl Send for LevelFilter
impl Sync for LevelFilter
impl Unpin for LevelFilter
impl UnwindSafe for LevelFilter
Blanket Implementations
Mutably borrows from an owned value. Read more
Attaches the provided Subscriber to this type, returning a
WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a
WithDispatch wrapper. Read more
