Loading...
Searching...
No Matches
by::errPassFilter Class Reference

Filter that passes through error-level log messages only. More...

#include <errPassFilter.hpp>

Inheritance diagram for by::errPassFilter:
by::filterable

Public Member Functions

nbool filt (errLv::level lv, const std::string &tag) const override
 Determines whether a log entry should be filtered out.
 

Detailed Description

Filter that passes through error-level log messages only.

As the name implies, a filterable class that only allows error-level logs to pass through. When this filter is registered with logger, warning and info logs will not be output.

Not used directly; instead, create an instance and add it to logger.

Usage

Example of using errPassFilter:

const filters& prevFilters = logger::get().getFilters();
logger::get().setFilters(fs);
// Now only error-level logs will be output
logger::get().setFilters(prevFilters); // Restore previous filters
Filter that passes through error-level log messages only.
Definition errPassFilter.hpp:27
Collection of filterable objects for logging control.
Definition filters.hpp:16
static logger & get()
Get singleton logger instance.
Rich logging support with polymorphic type conversion.
Definition richLog.hpp:34

Member Function Documentation

◆ filt()

nbool by::errPassFilter::filt ( errLv::level lv,
const std::string & tag ) const
overridevirtual

Determines whether a log entry should be filtered out.

Parameters
lvThe error level of the log entry.
tagThe tag associated with the log entry.
Returns
true if the log entry should be filtered out (not sent to stream), false otherwise.

Implements by::filterable.


The documentation for this class was generated from the following file: