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§
source§impl Filter
impl Filter
sourcepub fn filter(&self) -> LevelFilter
pub fn filter(&self) -> LevelFilter
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);