wibble  1.1
Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
wibble::log::Streambuf Class Reference

Streambuf class for logging. More...

#include <stream.h>

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

Public Member Functions

 Streambuf ()
 Construct a nonworking Streambuf to be initialised later. More...
 
 Streambuf (Sender *s)
 
virtual ~Streambuf ()
 
void send_partial_line ()
 If there is a partial line, send it out. More...
 
void setSender (Sender *s)
 Set/change the sender to use for this streambuf. More...
 
void setLevel (const Level &level)
 Set the level for the next message, and the next message only. More...
 
int overflow (int c)
 override to get data as a std::streambuf More...
 

Protected Member Functions

void send ()
 Send the message "line" with the level "level". More...
 

Protected Attributes

std::string line
 Line buffer with the log message we are building. More...
 
Level level
 Level of the next log message. More...
 
Sender * sender
 Sender used to send log messages. More...
 

Static Protected Attributes

static const Level defaultLevel = INFO
 Level to use for messages whose level has not been specified. More...
 

Detailed Description

Streambuf class for logging.

Constructor & Destructor Documentation

wibble::log::Streambuf::Streambuf ( )

Construct a nonworking Streambuf to be initialised later.

wibble::log::Streambuf::Streambuf ( Sender *  s)
Parameters
sThe sender to use to send log messages. Streambuf will just use the pointer, but will not take over memory maintenance
wibble::log::Streambuf::~Streambuf ( )
virtual

References send_partial_line().

Member Function Documentation

int wibble::log::Streambuf::overflow ( int  c)

override to get data as a std::streambuf

References line, and send().

void wibble::log::Streambuf::send ( )
protected

Send the message "line" with the level "level".

References defaultLevel, level, line, wibble::log::Sender::send(), and sender.

Referenced by overflow(), and send_partial_line().

void wibble::log::Streambuf::send_partial_line ( )

If there is a partial line, send it out.

References line, and send().

Referenced by ~Streambuf().

void wibble::log::Streambuf::setLevel ( const Level &  level)

Set the level for the next message, and the next message only.

References level.

void wibble::log::Streambuf::setSender ( Sender *  s)

Set/change the sender to use for this streambuf.

References sender.

Member Data Documentation

const Level wibble::log::Streambuf::defaultLevel = INFO
staticprotected

Level to use for messages whose level has not been specified.

Referenced by send().

Level wibble::log::Streambuf::level
protected

Level of the next log message.

Referenced by send(), and setLevel().

std::string wibble::log::Streambuf::line
protected

Line buffer with the log message we are building.

Referenced by overflow(), send(), and send_partial_line().

Sender* wibble::log::Streambuf::sender
protected

Sender used to send log messages.

Referenced by send(), and setSender().


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