Console: Refactor argument parsing into iterator
[senf.git] / Utils / Logger / Target.cc
index f1dd507..91d231e 100644 (file)
@@ -45,8 +45,8 @@ prefix_ senf::log::Target::Target()
 prefix_ senf::log::Target::~Target()
 {
     while( ! rib_.empty()) {
-        // This is terribly slow but simplifies the area cache handling and removing a target should
-        // be quite seldom
+        // This is slow but simplifies the area cache handling and removing a target should be
+        // relatively seldom
         RIB::reverse_iterator i (rib_.rbegin());
         unroute(i->stream_, i->area_, i->level_, i->action_);
     }
@@ -208,9 +208,11 @@ prefix_ void senf::log::detail::TargetRegistry::write(StreamBase const & stream,
                                                       AreaBase const & area, unsigned level,
                                                       std::string msg)
 {
-    if (fallbackRouting_)
-        static_cast<Target &>(ConsoleTarget::instance()).v_write( 
-            (*timeSource_)(), stream.v_name(), area.v_name(), level, msg );
+    if (fallbackRouting_) {
+        if (level >= stream.defaultRuntimeLimit())
+            static_cast<Target &>(ConsoleTarget::instance()).v_write( 
+                (*timeSource_)(), stream.v_name(), area.v_name(), level, msg );
+    }
     else
         area.write( (*timeSource_)(), stream, level, msg );
 }