Public Member Functions | Public Attributes

wibble::log::Timestamper Struct Reference

Prepend timestamps to log lines. More...

#include <filters.h>

Inheritance diagram for wibble::log::Timestamper:
Inheritance graph
[legend]
Collaboration diagram for wibble::log::Timestamper:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 Timestamper (Sender *next=0, const std::string &fmt="%b %e %T ")
virtual ~Timestamper ()
virtual void send (Level level, const std::string &msg)
 Log one line of text with the given level.

Public Attributes

Sendernext
std::string fmt

Detailed Description

Prepend timestamps to log lines.

Timestamps are generated with a strftime format string on POSIX systems, or with simple asctime() on windows.

Strftime expands using a buffer 256 characters wide. Please keep that in mind when creating the format string: longer outputs will be truncated.


Constructor & Destructor Documentation

wibble::log::Timestamper::Timestamper ( Sender next = 0,
const std::string &  fmt = "%b %e %T " 
)
wibble::log::Timestamper::~Timestamper (  )  [virtual]

Member Function Documentation

void wibble::log::Timestamper::send ( Level  level,
const std::string &  msg 
) [virtual]

Log one line of text with the given level.

Do not add a trailing newline

Implements wibble::log::Sender.

References fmt, next, wibble::grcal::date::now(), and wibble::log::Sender::send().


Member Data Documentation

Referenced by send().

Referenced by send().


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