X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=Utils%2FLogger%2FTarget.cc;h=c07ba211cc32349cb2857dcc8a5fbfe35366ceb9;hb=ac86c2bb40746fbedf70a19af3307e5da642b04a;hp=a7b734b2e5aac8791c9e20342324ee6b23c1ab8e;hpb=0d797005aea3471b1d4311709232ccf2c292f3c5;p=senf.git diff --git a/Utils/Logger/Target.cc b/Utils/Logger/Target.cc index a7b734b..c07ba21 100644 --- a/Utils/Logger/Target.cc +++ b/Utils/Logger/Target.cc @@ -67,6 +67,21 @@ prefix_ void senf::log::Target::route(std::string const & stream, std::string co route(s, a, level, action, index); } +prefix_ void senf::log::Target::unroute(std::string const & stream, std::string const & area, + unsigned level, action_t action) +{ + detail::StreamBase const * s (StreamRegistry::instance().lookup(stream)); + if (!s) + throw InvalidStreamException(); + detail::AreaBase const * a (0); + if (! area.empty()) { + a = AreaRegistry::instance().lookup(area); + if (!a) + throw InvalidAreaException(); + } + unroute(s, a, level, action); +} + prefix_ void senf::log::Target::unroute(int index) { RIB::iterator i; @@ -105,7 +120,7 @@ prefix_ void senf::log::Target::route(detail::StreamBase const * stream, i = rib_.begin(); else { i = rib_.end(); - std::advance(i, -index - 1); + std::advance(i, index + 1 ); } } else { if (RIB::size_type(index) >= rib_.size())