Skip to main content

RecordFilter

Trait RecordFilter 

Source
pub trait RecordFilter: Send + 'static {
    // Required method
    fn check(&self, record: &Record) -> bool;

    // Provided method
    fn fmt_debug(&self, f: &mut Formatter<'_>) -> Result { ... }
}
Expand description

Trait for filtering log records in LoggedStream.

This trait allows filtering log records (Record) using the check method, which returns a bool value. It should be implemented for structures intended to be used as the filtering component within LoggedStream.

Required Methods§

Source

fn check(&self, record: &Record) -> bool

This method returns bool value depending on if received log record (Record) should be processed by logging part inside LoggedStream.

Provided Methods§

Source

fn fmt_debug(&self, f: &mut Formatter<'_>) -> Result

This method provides fmt::Debug representation of the filter. It is used by composite filters (AllFilter and AnyFilter) to produce detailed debug output of their underlying filters. The default implementation outputs the type name as "UnknownFilter". Implementors are encouraged to override this method to provide meaningful debug information.

Implementations on Foreign Types§

Source§

impl<T: RecordFilter + ?Sized> RecordFilter for Box<T>

Source§

fn check(&self, record: &Record) -> bool

Source§

fn fmt_debug(&self, f: &mut Formatter<'_>) -> Result

Implementors§