#include <console_logger.h>


Public Types | |
| enum | stream_choices { TO_STDOUT, TO_STDERR } |
Public Member Functions | |
| console_logger (stream_choices log_target=TO_STDOUT) | |
| if "standard_error" is true, than stderr is used instead of stdout. | |
| virtual | ~console_logger () |
| DEFINE_CLASS_NAME ("console_logger") | |
| bool | to_standard_output () const |
| reports if the logger goes to standard output (default). | |
| bool | to_standard_error () const |
| reports if the logger goes to standard error instead. | |
| void | set_output (stream_choices target) |
| enables the target of logging to be changed after construction. | |
| virtual basis::outcome | log (const basis::base_string &info, int filter) |
| sends the string "info" to the standard output device. | |
Definition at line 32 of file console_logger.h.
Definition at line 35 of file console_logger.h.
| loggers::console_logger::console_logger | ( | stream_choices | log_target = TO_STDOUT |
) |
if "standard_error" is true, than stderr is used instead of stdout.
Definition at line 24 of file console_logger.cpp.
| loggers::console_logger::~console_logger | ( | ) | [virtual] |
Definition at line 27 of file console_logger.cpp.
| loggers::console_logger::DEFINE_CLASS_NAME | ( | "console_logger" | ) |
| outcome loggers::console_logger::log | ( | const basis::base_string & | info, | |
| int | filter | |||
| ) | [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 basis::base_logger.
Reimplemented in loggers::combo_logger.
Definition at line 29 of file console_logger.cpp.
References basis::base_string::observe(), and TO_STDERR.
Referenced by main().
| void loggers::console_logger::set_output | ( | stream_choices | target | ) | [inline] |
enables the target of logging to be changed after construction.
Definition at line 50 of file console_logger.h.
| bool loggers::console_logger::to_standard_error | ( | ) | const [inline] |
reports if the logger goes to standard error instead.
Definition at line 47 of file console_logger.h.
References TO_STDERR.
| bool loggers::console_logger::to_standard_output | ( | ) | const [inline] |
reports if the logger goes to standard output (default).
Definition at line 44 of file console_logger.h.
References TO_STDOUT.
1.6.3