wibble 1.1
Public Member Functions | Public Attributes | List of all members
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]

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 Member Functions inherited from wibble::log::Sender
virtual ~Sender ()
 

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

◆ Timestamper()

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

◆ ~Timestamper()

wibble::log::Timestamper::~Timestamper ( )
virtual

Member Function Documentation

◆ send()

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, and wibble::log::Sender::send().

Member Data Documentation

◆ fmt

std::string wibble::log::Timestamper::fmt

Referenced by send().

◆ next

Sender* wibble::log::Timestamper::next

Referenced by send().


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