#include <LogFilter.h>
Public Member Functions | |
LogFilter (const RegistryKey &key) | |
Constructor. Configures the LogFilter according to the information stored in the provided registry key. | |
LogFilter (LogLevel defaultLogLevel) | |
Constructor. Creates a LogFilter with no OriginRules. | |
bool | IsFiltered (const LogInfo &logInfo) |
Helper method which uses GetMaximumLogLevel() to determine whether message with provided LogInfo should be filtered. | |
LogLevel | GetMaximumLogLevel (const std::tstring &scopeLoggerName) |
This method returns the maximum LogLevel at which messages should be passed through this filter if they originate from "origin". | |
Private Types | |
typedef std::map< std::tstring, LogLevel >::const_iterator | OriginRulesIterator |
Private Member Functions | |
void | StripLastPart (std::tstring &originPrefix) |
Helper method which does in-place removal of the last part of the origin string (to and including the last dot character). | |
Private Attributes | |
std::map< std::tstring, LogLevel > | OriginRules |
Map containing the filtering rules. | |
LogLevel | DefaultLogLevel |
Default LogLevel to use when there is no match in OriginRules for particular origin. |
What this documentation and the LogFilter implementation refer to as "origin" is equivalent to the name of the ScopeLogger from which the log message originated.
Definition at line 39 of file LogFilter.h.
LogFilter | ( | const RegistryKey & | key | ) | [inline] |
Constructor. Configures the LogFilter according to the information stored in the provided registry key.
The structure of the configuration in the registry mirrors the structure of LogFilter object:
Definition at line 101 of file LogFilter.h.
References LogFilter::DefaultLogLevel, and LogFilter::OriginRules.
LogFilter | ( | LogLevel | defaultLogLevel | ) | [inline] |
Constructor. Creates a LogFilter with no OriginRules.
defaultLogLevel | The default LogLevel. |
Definition at line 99 of file LogFilter.h.
LogLevel GetMaximumLogLevel | ( | const std::tstring & | scopeLoggerName | ) | [inline] |
This method returns the maximum LogLevel at which messages should be passed through this filter if they originate from "origin".
Implementation of this method follows this algorithm:
Definition at line 136 of file LogFilter.h.
References LogFilter::DefaultLogLevel, LogFilter::OriginRules, and LogFilter::StripLastPart().
Referenced by Logger::GetMaximumLogLevel(), and LogFilter::IsFiltered().
std::map<std::tstring, LogLevel> OriginRules [private] |
Map containing the filtering rules.
Each mapping in the form ("someOrigin" -> someLevel) means that all messages whose:
should be filtered out.
Definition at line 52 of file LogFilter.h.
Referenced by LogFilter::GetMaximumLogLevel(), and LogFilter::LogFilter().