Struct env_logger::filter::Filter

source ·
pub struct Filter { /* private fields */ }
Expand description

A log filter.

This struct can be used to determine whether or not a log record should be written to the output. Use the Builder type to parse and construct a Filter.

Implementations§

Returns the maximum LevelFilter that this filter instance is configured to output.

Example
use log::LevelFilter;
use env_logger::filter::Builder;

let mut builder = Builder::new();
builder.filter(Some("module1"), LevelFilter::Info);
builder.filter(Some("module2"), LevelFilter::Error);

let filter = builder.build();
assert_eq!(filter.filter(), LevelFilter::Info);

Checks if this record matches the configured filter.

Determines if a log message with the specified metadata would be logged.

Trait Implementations§

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.