Utils/Logger: Fix the bugfix .. outch ...
[senf.git] / Utils / Logger / IOStreamTarget.cc
index 0de7da3..0d798bb 100644 (file)
@@ -38,6 +38,9 @@
 ///////////////////////////////////////////////////////////////////////////
 // senf::log::IOStreamTarget
 
+const char * const senf::log::IOStreamTarget::LEVELNAMES_[8] = {
+        "NONE", "VERBOSE", "NOTICE", "MESSAGE", "IMPORTANT", "CRITICAL", "FATAL", "DISABLED" };
+
 prefix_ senf::log::IOStreamTarget::IOStreamTarget(std::ostream & os)
     : stream_(os)
 {
@@ -68,9 +71,10 @@ prefix_ void senf::log::IOStreamTarget::v_write(boost::posix_time::ptime timesta
 
     for (; i != i_end; ++i) {
         stream_ << timestamp << sep;
+        stream_ << "[" << LEVELNAMES_[level] << "]";
         if (area != "senf::log::DefaultArea")
-            stream_ << "[" << area << "] ";
-        stream_ << *i << "\n";
+            stream_ << "[" << area << "]";
+        stream_ << " " << *i << "\n";
         sep = '-';
     }
     stream_ << std::flush;