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.
 
 Streambuf (Sender *s)
 
virtual ~Streambuf ()
 
void send_partial_line ()
 If there is a partial line, send it out.
 
void setSender (Sender *s)
 Set/change the sender to use for this streambuf.
 
void setLevel (const Level &level)
 Set the level for the next message, and the next message only.
 
int overflow (int c)
 override to get data as a std::streambuf
 

Protected Member Functions

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

Protected Attributes

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

Static Protected Attributes

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

Detailed Description

Streambuf class for logging.

Constructor & Destructor Documentation

◆ Streambuf() [1/2]

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

Construct a nonworking Streambuf to be initialised later.

◆ Streambuf() [2/2]

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

◆ ~Streambuf()

wibble::log::Streambuf::~Streambuf ( )
virtual

References send_partial_line().

Member Function Documentation

◆ overflow()

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

override to get data as a std::streambuf

References line, and send().

◆ 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().

◆ 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().

◆ setLevel()

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

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

References level.

◆ setSender()

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

Set/change the sender to use for this streambuf.

References sender.

Member Data Documentation

◆ defaultLevel

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

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

Referenced by send().

◆ level

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

Level of the next log message.

Referenced by send(), and setLevel().

◆ line

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

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: