28 const std::string LogFilter::TAG =
"BundleFilter";
31 : _level(ibrcommon::LogLevel::debug), _msg(msg), _debug_level(debug_level)
36 : _level(level), _msg(msg), _debug_level(1)
44 void LogFilter::log(
const FilterContext &context)
const throw ()
49 case ibrcommon::LogLevel::emergency:
50 IBRCOMMON_LOGGER_TAG(
TAG, emergency) << _msg <<
" (" << context.getBundleID().toString() <<
")" << IBRCOMMON_LOGGER_ENDL;
53 case ibrcommon::LogLevel::alert:
54 IBRCOMMON_LOGGER_TAG(
TAG, alert) << _msg <<
" (" << context.getBundleID().toString() <<
")" << IBRCOMMON_LOGGER_ENDL;
57 case ibrcommon::LogLevel::critical:
58 IBRCOMMON_LOGGER_TAG(
TAG, critical) << _msg <<
" (" << context.getBundleID().toString() <<
")" << IBRCOMMON_LOGGER_ENDL;
61 case ibrcommon::LogLevel::error:
62 IBRCOMMON_LOGGER_TAG(
TAG, error) << _msg <<
" (" << context.getBundleID().toString() <<
")" << IBRCOMMON_LOGGER_ENDL;
65 case ibrcommon::LogLevel::warning:
66 IBRCOMMON_LOGGER_TAG(
TAG, warning) << _msg <<
" (" << context.getBundleID().toString() <<
")" << IBRCOMMON_LOGGER_ENDL;
69 case ibrcommon::LogLevel::notice:
70 IBRCOMMON_LOGGER_TAG(
TAG, notice) << _msg <<
" (" << context.getBundleID().toString() <<
")" << IBRCOMMON_LOGGER_ENDL;
73 case ibrcommon::LogLevel::info:
74 IBRCOMMON_LOGGER_TAG(
TAG, info) << _msg <<
" (" << context.getBundleID().toString() <<
")" << IBRCOMMON_LOGGER_ENDL;
77 case ibrcommon::LogLevel::debug:
78 IBRCOMMON_LOGGER_DEBUG_TAG(
TAG, _debug_level) << _msg <<
" (" << context.getBundleID().toString() <<
")" << IBRCOMMON_LOGGER_ENDL;
81 }
catch (
const FilterException&) {
virtual ACTION filter(const FilterContext &, dtn::data::Bundle &) const
virtual ACTION evaluate(const FilterContext &) const
virtual ACTION evaluate(const FilterContext &context) const
virtual ACTION filter(const FilterContext &context, dtn::data::Bundle &bundle) const
LogFilter(const ibrcommon::LogLevel::Level level, const std::string &msg)