47 #ifndef _MIRA_LOGCUSTOMIZABLEFILTER_H_ 48 #define _MIRA_LOGCUSTOMIZABLEFILTER_H_ 112 template <
typename Derived>
118 template<LogCustomizableFilter::CompareFlags F = LogCustomizableFilter::EQUAL>
122 Class(
const std::string& iClassName) :
142 template<LogCustomizableFilter::CompareFlags F = LogCustomizableFilter::EQUAL>
166 template<LogCustomizableFilter::CompareFlags F = LogCustomizableFilter::LESS_EQUAL>
198 template<LogCustomizableFilter::CompareFlags F = LogCustomizableFilter::EQUAL>
222 template <
typename F1,
typename F2>
228 mF1.reset(
new F1(f1));
229 mF2.reset(
new F2(f2));
234 return mF1->filter(record) && mF2->filter(record);
238 boost::shared_ptr<LogCustomizableFilter::CustomFilterBase> mF1;
239 boost::shared_ptr<LogCustomizableFilter::CustomFilterBase> mF2;
245 template <
typename F1,
typename F2>
251 mF1.reset(
new F1(f1));
252 mF2.reset(
new F2(f2));
257 return mF1->filter(record) || mF2->filter(record);
261 boost::shared_ptr<LogCustomizableFilter::CustomFilterBase> mF1;
262 boost::shared_ptr<LogCustomizableFilter::CustomFilterBase> mF2;
273 mFilter.push_back(boost::shared_ptr<
281 for (
size_t i = 0; i <
mFilter.size(); ++i)
288 std::vector<boost::shared_ptr<LogCustomizableFilter::CustomFilterBase> >
mFilter;
295 template <
typename Derived1,
typename Derived2>
299 const Derived1* t1 = (
const Derived1*)&f1;
300 const Derived2* t2 = (
const Derived2*)&f2;
308 template <
typename Derived1,
typename Derived2>
312 const Derived1* t1 = (
const Derived1*)&f1;
313 const Derived2* t2 = (
const Derived2*)&f2;
SeverityLevel level
Definition: LogCustomizableFilter.h:192
SeverityLevel level
Definition: LoggingCore.h:109
Class filter, used to filter log entries with a given class name.
Definition: LogCustomizableFilter.h:119
Severity(SeverityLevel iLevel)
Definition: LogCustomizableFilter.h:170
ThreadID threadID
Definition: LogCustomizableFilter.h:216
Holds all the information about a log entry.
Definition: LoggingCore.h:107
AndOperator(const F1 &f1, const F2 &f2)
Definition: LogCustomizableFilter.h:226
LogCustomizableFilter & operator<<(const T &f)
Add filters by chaining them with this operator.
Definition: LogCustomizableFilter.h:271
std::string ns
Definition: LogCustomizableFilter.h:160
Abstract base class for log filters.
Definition: LoggingCore.h:183
specialize cv::DataType for our ImgPixel and inherit from cv::DataType<Vec>
Definition: IOService.h:67
A customizable log filter to match the users needs.
Definition: LogCustomizableFilter.h:79
virtual bool filter(const LogRecord &record)
Called by LogCustomizableFilter whenever a new log entry is getting filtered.
Definition: LogCustomizableFilter.h:255
Class(const std::string &iClassName)
Definition: LogCustomizableFilter.h:122
virtual bool filter(const LogRecord &record)
Filters a log entry.
Definition: LogCustomizableFilter.h:279
Namespace filter, used to filter log entries with a given namespace.
Definition: LogCustomizableFilter.h:143
CompareFlags
Definition: LogCustomizableFilter.h:82
uint32 ThreadID
Platform independent thread ID.
Definition: ThreadID.h:68
LogCustomizableFilter::AndOperator< Derived1, Derived2 > operator &(const LogCustomizableFilter::CustomFilter< Derived1 > &f1, const LogCustomizableFilter::CustomFilter< Derived2 > &f2)
Operator to combine filters by and.
Definition: LogCustomizableFilter.h:296
SeverityLevel
Severity levels to graduate between different log outputs.
Definition: LoggingCore.h:72
Definition: LogCustomizableFilter.h:85
virtual bool filter(const LogRecord &record)
Called by LogCustomizableFilter whenever a new log entry is getting filtered.
Definition: LogCustomizableFilter.h:232
Definition: LogCustomizableFilter.h:88
Operator class used to combine two custom filters by the & operator.
Definition: LogCustomizableFilter.h:223
virtual bool filter(const LogRecord &record)
Called by LogCustomizableFilter whenever a new log entry is getting filtered.
Definition: LogCustomizableFilter.h:127
Definition: LogCustomizableFilter.h:87
Namespace(const std::string &iNS)
Definition: LogCustomizableFilter.h:146
Core class of the logging library.
Definition: LogCustomizableFilter.h:84
virtual bool filter(const LogRecord &record)
Called by LogCustomizableFilter whenever a new log entry is getting filtered.
Definition: LogCustomizableFilter.h:207
LogCustomizableFilter::OrOperator< Derived1, Derived2 > operator|(const LogCustomizableFilter::CustomFilter< Derived1 > &f1, const LogCustomizableFilter::CustomFilter< Derived2 > &f2)
Operator to combine filters by or.
Definition: LogCustomizableFilter.h:309
Definition: LogCustomizableFilter.h:89
Severity filter, used to filter log entries with a given severity level.
Definition: LogCustomizableFilter.h:167
Operator class used to combine two custom filters by the | operator.
Definition: LogCustomizableFilter.h:246
virtual bool filter(const LogRecord &record)=0
Called by LogCustomizableFilter whenever a new log entry is getting filtered.
virtual ~CustomFilterBase()
Definition: LogCustomizableFilter.h:98
std::string className
Definition: LogCustomizableFilter.h:136
ThreadID filter, used to filter log entries with a given thread id.
Definition: LogCustomizableFilter.h:199
virtual bool filter(const LogRecord &record)
Called by LogCustomizableFilter whenever a new log entry is getting filtered.
Definition: LogCustomizableFilter.h:151
ThreadID threadID
Definition: LoggingCore.h:117
Thread(ThreadID iThreadID)
Definition: LogCustomizableFilter.h:202
virtual bool filter(const LogRecord &record)
Called by LogCustomizableFilter whenever a new log entry is getting filtered.
Definition: LogCustomizableFilter.h:175
Abstract base class for custom filters.
Definition: LogCustomizableFilter.h:95
Helper class to get the type info of the derived class.
Definition: LogCustomizableFilter.h:113
Definition: LogCustomizableFilter.h:86
#define MIRA_LOGGER
Macro for easier access to the logging core instance.
Definition: LoggingCore.h:417
OrOperator(const F1 &f1, const F2 &f2)
Definition: LogCustomizableFilter.h:249
std::vector< boost::shared_ptr< LogCustomizableFilter::CustomFilterBase > > mFilter
Definition: LogCustomizableFilter.h:288