X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=Utils%2FLogger%2FIOStreamTarget.cc;h=487e508ca01a071377de1138144498f752d34cac;hb=42f556b7d7c8f210c5919fcb298b0dccdae568e3;hp=f5e3a6faa73208d3952b35da97080ceeb58cb5f1;hpb=012a592d56be453719b7fbba492b56ae804c048f;p=senf.git diff --git a/Utils/Logger/IOStreamTarget.cc b/Utils/Logger/IOStreamTarget.cc index f5e3a6f..487e508 100644 --- a/Utils/Logger/IOStreamTarget.cc +++ b/Utils/Logger/IOStreamTarget.cc @@ -1,8 +1,8 @@ // $Id$ // -// Copyright (C) 2007 -// Fraunhofer Institut fuer offene Kommunikationssysteme (FOKUS) -// Kompetenzzentrum fuer NETwork research (NET) +// Copyright (C) 2007 +// Fraunhofer Institute for Open Communication Systems (FOKUS) +// Competence Center NETwork research (NET), St. Augustin, GERMANY // Stefan Bund // // This program is free software; you can redistribute it and/or modify @@ -30,6 +30,7 @@ #include #include #include +#include //#include "IOStreamTarget.mpp" #define prefix_ @@ -38,6 +39,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) { @@ -50,7 +54,7 @@ prefix_ senf::log::IOStreamTarget::IOStreamTarget(std::ostream & os) //////////////////////////////////////// // private members -prefix_ void senf::log::IOStreamTarget::v_write(boost::posix_time::ptime timestamp, +prefix_ void senf::log::IOStreamTarget::v_write(time_type timestamp, std::string const & stream, std::string const & area, unsigned level, std::string const & message) @@ -68,9 +72,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;