[−][src]Struct sunrise_kernel::log_impl::filter::Builder
A builder for a log filter.
It can be used to parse a set of directives from a string before building
a Filter
instance.
Example
#[macro_use] extern crate log; extern crate env_logger; use std::env; use std::io; use env_logger::filter::Builder; fn main() { let mut builder = Builder::new(); // Parse a logging filter from an environment variable. if let Ok(rust_log) = env::var("RUST_LOG") { builder.parse(&rust_log); } let filter = builder.build(); }
Fields
directives: SmallVec<[Directive; 1]>
filter: Option<Filter>
Implementations
impl Builder
[src]
pub fn new() -> Builder
[src]
Initializes the filter builder with defaults.
pub fn filter_module(&mut self, module: &str, level: LevelFilter) -> &mut Self
[src]
Initializes the filter builder from an environment. Adds a directive to the filter for a specific module.
pub fn filter_level(&mut self, level: LevelFilter) -> &mut Self
[src]
Adds a directive to the filter for all modules.
pub fn filter(&mut self, module: Option<&str>, level: LevelFilter) -> &mut Self
[src]
Adds a directive to the filter.
The given module (if any) will log at most the specified level provided. If no module is provided then the filter will apply to all log messages.
pub fn parse(&mut self, filters: &str) -> &mut Self
[src]
Parses the directives string.
See the Enabling Logging section for more details.
pub fn build(&mut self) -> Filter
[src]
Build a log filter.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Builder
impl Send for Builder
impl Sync for Builder
impl Unpin for Builder
impl UnwindSafe for Builder
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,