X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=Utils%2FLogger%2FTarget.cc;h=c07ba211cc32349cb2857dcc8a5fbfe35366ceb9;hb=ac86c2bb40746fbedf70a19af3307e5da642b04a;hp=e6fdc0cbe678c0ac4df060110f5612406d1cdfa7;hpb=56ec4faa5dcae61746a78375cb7de605d0b79738;p=senf.git diff --git a/Utils/Logger/Target.cc b/Utils/Logger/Target.cc index e6fdc0c..c07ba21 100644 --- a/Utils/Logger/Target.cc +++ b/Utils/Logger/Target.cc @@ -27,6 +27,7 @@ //#include "Target.ih" // Custom includes +#include //#include "Target.mpp" #define prefix_ @@ -66,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; @@ -104,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())