17 #ifndef _LOG4CXX_FILTER_MAPFILTER_H 18 #define _LOG4CXX_FILTER_MAPFILTER_H 20 #include <log4cxx/spi/filter.h> 23 #pragma warning ( push ) 24 #pragma warning ( disable: 4251 ) 45 typedef std::map < LogString, LogString > KeyVals;
54 BEGIN_LOG4CXX_CAST_MAP()
57 END_LOG4CXX_CAST_MAP()
64 virtual void setOption(
const LogString& option,
65 const LogString& value);
67 inline void setKeyValue(
const LogString& strKey,
const LogString& strValue)
69 this->keyVals[strKey] = strValue;
72 inline const LogString& getValue(
const LogString& strKey)
const 74 static const LogString empty;
75 const KeyVals::const_iterator it(this->keyVals.find(strKey));
77 return (it != keyVals.end() ? it->second : empty);
80 inline void setAcceptOnMatch(
bool acceptOnMatch1)
82 this->acceptOnMatch = acceptOnMatch1;
85 inline bool getAcceptOnMatch()
const 90 inline bool getMustMatchAll()
const 95 inline void setMustMatchAll(
bool mustMatchAll1)
97 this->mustMatchAll = mustMatchAll1;
112 #if defined(_MSC_VER) 113 #pragma warning (pop) 116 #endif // _LOG4CXX_FILTER_MAPFILTER_H FilterDecision
Definition: filter.h:91
A Filter that operates on a Map and can be used like in the following example:
Definition: mapfilter.h:43
Definition: appender.h:33
Users should extend this class to implement customized logging event filtering.
Definition: filter.h:69