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

Outputs log messages to a named file. More...

#include <mbl_log.h>

Inheritance diagram for mbl_log_output_file:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 mbl_log_output_file (const vcl_string &filename, 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_ofstream file_
 The file 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 a named file.

Definition at line 157 of file mbl_log.h.


Constructor & Destructor Documentation

mbl_log_output_file::mbl_log_output_file ( const vcl_string &  filename,
const char *  id 
)

Definition at line 237 of file mbl_log.cxx.


Member Function Documentation

void mbl_log_output_file::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 273 of file mbl_log.cxx.

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

Which logger id are we using.

Implements mbl_log_output_base.

Definition at line 185 of file mbl_log.h.

void mbl_log_output_file::start ( ) [private]

Start a new log entry, with id info.

Definition at line 242 of file mbl_log.cxx.

void mbl_log_output_file::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 265 of file mbl_log.cxx.

void mbl_log_output_file::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 256 of file mbl_log.cxx.

void mbl_log_output_file::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 294 of file mbl_log.cxx.

void mbl_log_output_file::terminate_manual ( ) [virtual]

Finish the log entry, sent from a stream flush.

Implements mbl_log_output_base.

Definition at line 287 of file mbl_log.cxx.


Member Data Documentation

vcl_ofstream mbl_log_output_file::file_ [private]

The file where logging finally gets sent.

Definition at line 160 of file mbl_log.h.

true if a log entry is in progress.

Definition at line 164 of file mbl_log.h.

const char* mbl_log_output_file::id_ [private]

logger identity.

Definition at line 162 of file mbl_log.h.

Ignore calls to terminate_flush.

The current log message should be manually terminated.

Definition at line 169 of file mbl_log.h.


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