Outputs log messages to an existing stream (e.g. vcl_cerr). More...
#include <mbl_log.h>
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. |
Outputs log messages to an existing stream (e.g. vcl_cerr).
mbl_log_output_stream::mbl_log_output_stream | ( | vcl_ostream & | real_stream, |
const char * | id | ||
) |
Definition at line 172 of file mbl_log.cxx.
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.
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.
bool mbl_log_output_stream::has_started_ [private] |
const char* mbl_log_output_stream::id_ [private] |
bool mbl_log_output_stream::ignore_flush_ [private] |
vcl_ostream* mbl_log_output_stream::real_stream_ [private] |