// $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 <g0dil@berlios.de>
//
// This program is free software; you can redistribute it and/or modify
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
- <pre>
- <date> [<area>] <message>
- </pre>
+ This target will write %log messages to an arbitrary std::ostream in the format
+ \verbatim <date> [<level>][<area>] <message> \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
\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.
+
+ \ingroup targets
*/
class IOStreamTarget
: public Target
///////////////////////////////////////////////////////////////////////////
protected:
-
- private:
void v_write(boost::posix_time::ptime 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////////////////////////////////////////