miscellaneous bits and bobs ;)
[senf.git] / Utils / Logger / IOStreamTarget.cc
index fd1260c..dbf4454 100644 (file)
@@ -1,8 +1,8 @@
 // $Id$
 //
-// Copyright (C) 2007 
-// Fraunhofer Institute for Open Communication Systems (FOKUS) 
-// Competence Center NETwork research (NET), St. Augustin, GERMANY 
+// Copyright (C) 2007
+// Fraunhofer Institute for Open Communication Systems (FOKUS)
+// Competence Center NETwork research (NET), St. Augustin, GERMANY
 //     Stefan Bund <g0dil@berlios.de>
 //
 // This program is free software; you can redistribute it and/or modify
@@ -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,6 +71,7 @@ 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";