17 #ifndef _LOG4CXX_VARIA_STAR_OPTION_FILTER_H
18 #define _LOG4CXX_VARIA_STAR_OPTION_FILTER_H
21 #include <log4cxx/spi/filter.h>
60 class StarOptionFilter;
61 typedef helpers::ObjectPtrT<StarOptionFilter> StarOptionFilterPtr;
66 static String ACCEPT_REPEAT_COUNTER;
67 static String STRING_TO_COUNT_OPTION;
68 static String TOTAL_MESSAGE_LIMIT;
70 int acceptRepeatCounter;
71 int acceptTotalCounter;
72 mutable int currentRepeatCounter;
73 mutable int currentTotalCounter;
74 mutable String lastLoggerMessageToCompare;
75 bool matchPredefinedStringOnly;
78 typedef spi::Filter BASE_CLASS;
80 BEGIN_LOG4CXX_CAST_MAP()
82 LOG4CXX_CAST_ENTRY_CHAIN(BASE_CLASS)
83 END_LOG4CXX_CAST_MAP()
90 virtual void setOption(
const String& option,
93 void setRepeatCounterOption(
int value);
94 void setTotalCounterOption(
int value);
96 inline void setAcceptRepeatCounter(
int repeat)
97 { this->acceptRepeatCounter = repeat; }
99 inline int RepeatCounter()
const
100 {
return acceptRepeatCounter; }
102 inline int TotalCounter()
const
103 {
return acceptTotalCounter; }
105 inline const String& lastLoggerMessage()
const
106 {
return lastLoggerMessageToCompare; }
112 FilterDecision decide(
const spi::LoggingEventPtr& event)
const;
117 #endif // _LOG4CXX_VARIA_STAR_OPTION_FILTER_H