senf::log::IOStreamTarget Class Reference
[Targets]

Write log messages to arbitrary std::ostream. More...

#include <senf/Utils/Logger/IOStreamTarget.hh>

Inheritance diagram for senf::log::IOStreamTarget:
Inheritance graph
[legend]

List of all members.


Detailed Description

Write log messages to arbitrary std::ostream.

This target will write log messages to an arbitrary std::ostream in the format

<date> [<level>][<area>] <message> 

The area will be omitted if it is senf::log::DefaultArea.

Warning:
The class keeps a reference to the passed stream.

Definition at line 50 of file IOStreamTarget.hh.


Structors and default members

  IOStreamTarget (std::string const &name, std::ostream &os)

Protected Member Functions

void  v_write (time_type timestamp, std::string const &stream, std::string const &area, unsigned level, std::string const &message)
  Called to write out the routing message.

Constructor & Destructor Documentation

senf::log::IOStreamTarget::
IOStreamTarget ( std::string const &  name,
std::ostream &  os )

Definition at line 33 of file IOStreamTarget.cci.


Member Function Documentation

void senf::log::IOStreamTarget::
v_write ( time_type  timestamp,
std::string const &  stream,
std::string const &  area,
unsigned  level,
std::string const &  message )

Called to write out the routing message.

This member must be defined in the derived class to somehow format and write the log message.

Every log message always possesses a complete set of meta information (stream, area and level).

Note:
This member must not block since it may be called from any unknown context. This prohibits simple logging over NFS or many other network protocols.
Parameters:
[in]  timestamp  log message timing information
[in]  stream  message stream
[in]  area  message area
[in]  level  message level
[in]  message  the message string

Implements senf::log::Target.

Definition at line 40 of file IOStreamTarget.cc.


The documentation for this class was generated from the following files: