This class checks if some log message shall be forwarded to some sink.
More...
#include <Filter.h>
|
const auto & | data () const |
| Returns the internal filter data. More...
|
|
Filter & | operator() (const std::string &channel, LogLevel level) |
| Set the minimum log level for some channel. More...
|
|
bool | check (const std::string &channel, LogLevel level) const noexcept |
| Checks if the given log level is sufficient for the log message to be forwarded. More...
|
|
This class checks if some log message shall be forwarded to some sink.
Definition at line 15 of file Filter.h.
◆ check()
bool carl::logging::Filter::check |
( |
const std::string & |
channel, |
|
|
LogLevel |
level |
|
) |
| const |
|
inlinenoexcept |
Checks if the given log level is sufficient for the log message to be forwarded.
- Parameters
-
channel | Channel name. |
level | LogLevel. |
- Returns
- If the message shall be forwarded.
Definition at line 44 of file Filter.h.
◆ data()
const auto& carl::logging::Filter::data |
( |
| ) |
const |
|
inline |
Returns the internal filter data.
Definition at line 24 of file Filter.h.
◆ operator()()
Filter& carl::logging::Filter::operator() |
( |
const std::string & |
channel, |
|
|
LogLevel |
level |
|
) |
| |
|
inline |
Set the minimum log level for some channel.
Returns *this
, hence calls to this method can be chained arbitrarily.
- Parameters
-
channel | Channel name. |
level | LogLevel. |
- Returns
- This object.
Definition at line 34 of file Filter.h.
◆ operator<<
std::ostream& operator<< |
( |
std::ostream & |
os, |
|
|
const Filter & |
f |
|
) |
| |
|
friend |
Streaming operator for a Filter.
All the rules stored in the filter are printed in a human-readable fashion.
- Parameters
-
- Returns
- os.
Definition at line 66 of file Filter.h.
◆ mData
std::map<std::string, LogLevel> carl::logging::Filter::mData |
|
private |
Initial value:= {
}
@ LVL_DEFAULT
Default log level.
Mapping from channels to (minimal) log levels.
Definition at line 17 of file Filter.h.
The documentation for this class was generated from the following file: