}
prefix_ void senf::log::Target::unroute(detail::StreamBase const * stream,
- detail::AreaBase const * area, unsigned level,
+ detail::AreaBase const * area, unsigned level,
action_t action)
{
- RIB::iterator i = std::find(rib_.begin(), rib_.end(),
+ RIB::iterator i = std::find(rib_.begin(), rib_.end(),
RoutingEntry(stream, area, level, action));
if (i != rib_.end())
unroute(std::distance(rib_.begin(), i));
if ( (! i->stream_ || i->stream_ == stream) &&
(! i->area_ || i->area_ == area) &&
i->action_ == ACCEPT ) {
- unsigned l (i->level_ == NONE::value ? i->stream_->defaultRuntimeLimit() : i->level_);
+ unsigned l (i->level_ == NONE::value ? stream->defaultRuntimeLimit() : i->level_);
if (l < limit)
limit = l;
}
for (; i != i_end; ++i)
if ( (! i->stream_ || i->stream_ == &stream) &&
(! i->area_ || i->area_ == &area) &&
- (i->level_ == NONE::value ? i->stream_->defaultRuntimeLimit() : i->level_) <= level ) {
+ (i->level_ == NONE::value ? stream.defaultRuntimeLimit() : i->level_) <= level ) {
if (i->action_ == ACCEPT)
v_write(timestamp, stream.v_name(), area.v_name(), level, message);
return;
prefix_ void senf::log::detail::TargetRegistry::write(StreamBase const & stream,
AreaBase const & area, unsigned level,
- std::string msg)
+ std::string const & msg)
{
if (fallbackRouting_) {
if (level >= stream.defaultRuntimeLimit())
- static_cast<Target &>(ConsoleTarget::instance()).v_write(
+ static_cast<Target &>(ConsoleTarget::instance()).v_write(
TimeSource::now(), stream.v_name(), area.v_name(), level, msg );
}
else
area.write( TimeSource::now(), stream, level, msg );
}
+///////////////////////////////////////////////////////////////////////////
+// namespace members
+
+prefix_ std::ostream & senf::log::operator<<(std::ostream & os, senf::log::Target::action_t const & action)
+{
+ if( action == Target::ACCEPT) os << "ACCEPT";
+ else if( action == Target::REJECT) os << "REJECT";
+ else os << "unknown action";
+ return os;
+}
+
///////////////////////////////cc.e////////////////////////////////////////
#undef prefix_
//#include "Target.mpp"
-\f
+
// Local Variables:
// mode: c++
// fill-column: 100