X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=Utils%2FLogger%2FIOStreamTarget.hh;h=05f9eee1564abc00068a07fa551df87f3f857233;hb=456ee576285b76aa46240f8001f426757810dcc1;hp=745ee798afd6652834cf8fb1f05f56e6f7e92015;hpb=394a298567543441521439ad15f7016cd569c449;p=senf.git diff --git a/Utils/Logger/IOStreamTarget.hh b/Utils/Logger/IOStreamTarget.hh index 745ee79..05f9eee 100644 --- a/Utils/Logger/IOStreamTarget.hh +++ b/Utils/Logger/IOStreamTarget.hh @@ -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 @@ -37,12 +37,12 @@ namespace senf { namespace log { - /** \brief Write log messages to arbitrary std::ostream + /** \brief Write %log messages to arbitrary std::ostream - This target will write log messages to an arbitrary std::ostream in the format -
-         [] 
-        
+ This target will write %log messages to an arbitrary std::ostream in the format + \verbatim [][] \endverbatim + + The \e area will be omitted if it is \c senf::log::DefaultArea. The date formatting is set using the Boost.DateTime date_facet, e.g.: \code @@ -55,10 +55,9 @@ namespace log { \warning The class keeps a reference to the passed stream. \note This class will permanently and globally change the date formating of the given - stream. + stream if no \c boost::posix_time::time_facet has been set. - \fixme Implement more robust formatting: Find line-breaks in the message and repeat the - prefix (with continuation markers) + \ingroup targets */ class IOStreamTarget : public Target @@ -74,16 +73,15 @@ namespace log { /////////////////////////////////////////////////////////////////////////// protected: - - private: - void v_write(boost::posix_time::ptime timestamp, std::string const & stream, + void v_write(time_type timestamp, std::string const & stream, std::string const & area, unsigned level, std::string const & message); + private: std::ostream & stream_; + static char const * const LEVELNAMES_[8]; }; - }} ///////////////////////////////hh.e////////////////////////////////////////