Public Member Functions | Private Member Functions | Private Attributes
mbl_log_output_stream Class Reference

Outputs log messages to an existing stream (e.g. vcl_cerr). More...

#include <mbl_log.h>

Inheritance diagram for mbl_log_output_stream:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 mbl_log_output_stream (vcl_ostream &real_stream, const char *id)
virtual void start_with_manual_termination (int level, const char *srcfile, int srcline)
 Start a new log entry, with id info.
virtual void start_with_flush_termination (int level, const char *srcfile, int srcline)
 Start a new log entry, with id info.
virtual void append (const char *contents, vcl_streamsize n_chars)
 Add contents to the existing log entry.
virtual void terminate_manual ()
 Finish the log entry, sent from a stream flush.
virtual void terminate_flush ()
 Finish the log entry, sent from explicit function call, e.g. by MBL_LOG.
virtual const char * id ()
 Which logger id are we using.

Private Member Functions

void start ()
 Start a new log entry, with id info.

Private Attributes

vcl_ostream * real_stream_
 A pointer to the stream where logging finally gets sent.
const char * id_
 logger identity.
bool has_started_
 true if a log entry is in progress.
bool ignore_flush_
 Ignore calls to terminate_flush.

Detailed Description

Outputs log messages to an existing stream (e.g. vcl_cerr).

Definition at line 125 of file mbl_log.h.


Constructor & Destructor Documentation

mbl_log_output_stream::mbl_log_output_stream ( vcl_ostream &  real_stream,
const char *  id 
)

Definition at line 172 of file mbl_log.cxx.


Member Function Documentation

void mbl_log_output_stream::append ( const char *  contents,
vcl_streamsize  n_chars 
) [virtual]

Add contents to the existing log entry.

add contents to the existing log entry.

Implements mbl_log_output_base.

Definition at line 207 of file mbl_log.cxx.

virtual const char* mbl_log_output_stream::id ( ) [inline, virtual]

Which logger id are we using.

Implements mbl_log_output_base.

Definition at line 153 of file mbl_log.h.

void mbl_log_output_stream::start ( ) [private]

Start a new log entry, with id info.

Definition at line 177 of file mbl_log.cxx.

void mbl_log_output_stream::start_with_flush_termination ( int  level,
const char *  srcfile,
int  srcline 
) [virtual]

Start a new log entry, with id info.

Future calls to terminate_flush will be honoured.

Implements mbl_log_output_base.

Definition at line 200 of file mbl_log.cxx.

void mbl_log_output_stream::start_with_manual_termination ( int  level,
const char *  srcfile,
int  srcline 
) [virtual]

Start a new log entry, with id info.

Future calls to terminate_flush will be ignored.

Implements mbl_log_output_base.

Definition at line 191 of file mbl_log.cxx.

void mbl_log_output_stream::terminate_flush ( ) [virtual]

Finish the log entry, sent from explicit function call, e.g. by MBL_LOG.

Implements mbl_log_output_base.

Definition at line 228 of file mbl_log.cxx.

void mbl_log_output_stream::terminate_manual ( ) [virtual]

Finish the log entry, sent from a stream flush.

Implements mbl_log_output_base.

Definition at line 221 of file mbl_log.cxx.


Member Data Documentation

true if a log entry is in progress.

Definition at line 132 of file mbl_log.h.

const char* mbl_log_output_stream::id_ [private]

logger identity.

Definition at line 130 of file mbl_log.h.

Ignore calls to terminate_flush.

The current log message should be manually terminated.

Definition at line 137 of file mbl_log.h.

vcl_ostream* mbl_log_output_stream::real_stream_ [private]

A pointer to the stream where logging finally gets sent.

Definition at line 128 of file mbl_log.h.


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