console_logger Class Reference

A logger that sends to the console screen using the standard output device. More...

#include <console_logger.h>

Inheritance diagram for console_logger:

Inheritance graph
[legend]
Collaboration diagram for console_logger:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 console_logger (bool standard_error=false)
 if "standard_error" is true, than stderr is used instead of stdout.
virtual ~console_logger ()
 IMPLEMENT_CLASS_NAME ("console_logger")
bool standard_output () const
 reports if the logger goes to standard output (default).
bool standard_error () const
 reports if the logger goes to standard error instead.
void set_output (bool standard_error)
 allows the target of logging to be changed after construction.
virtual outcome log (const istring &info, int filter=ALWAYS_PRINT)
 sends the string "info" to the standard output device.

Detailed Description

A logger that sends to the console screen using the standard output device.

The object can optionally be used to log to the standard error device instead.

Definition at line 29 of file console_logger.h.


Constructor & Destructor Documentation

console_logger::console_logger ( bool  standard_error = false  ) 

if "standard_error" is true, than stderr is used instead of stdout.

Definition at line 25 of file console_logger.cpp.

console_logger::~console_logger (  )  [virtual]

Definition at line 29 of file console_logger.cpp.


Member Function Documentation

console_logger::IMPLEMENT_CLASS_NAME ( "console_logger"   ) 

bool console_logger::standard_output (  )  const [inline]

reports if the logger goes to standard output (default).

Definition at line 38 of file console_logger.h.

bool console_logger::standard_error (  )  const [inline]

reports if the logger goes to standard error instead.

Definition at line 40 of file console_logger.h.

void console_logger::set_output ( bool  standard_error  )  [inline]

allows the target of logging to be changed after construction.

Definition at line 43 of file console_logger.h.

outcome console_logger::log ( const istring info,
int  filter = ALWAYS_PRINT 
) [virtual]

sends the string "info" to the standard output device.

if the "filter" is not in the current filter set, then the information will be dropped. otherwise the information is displayed, where appropriate. for some environments, this will essentially throw it away. for example, in ms-windows, a windowed program will only save standard out if one redirects standard output to a file, whereas a console mode program will output the text to its parent prompt.

Implements log_base.

Definition at line 31 of file console_logger.cpp.

References log_base::eol(), log_base::get_ending(), log_base::member(), log_base::NO_ENDING, common::OKAY, and istring::s().

Referenced by log(), and combo_logger::log().


The documentation for this class was generated from the following files:
Generated on Fri Aug 29 04:30:24 2008 for HOOPLE Libraries by  doxygen 1.5.1