The event logger is a static class: you cannot instantiate it, use only its static methods. This ensures static storage is handled properly in terms of memory management, while giving a clean, object-oriented interface.
Simply use the SetStream method with a pointer to your logging stream, or use null to disable logging. Thanks to polymorphism, this stream could be standard output, standard error, a file, or even a string stream.
Once you assign a string, simply call the printLine() method. As its name implies, it adds a newline onto your output for you.
Definition at line 79 of file eventlog.hpp.
Static Public Member Functions | |
| static bool | printLine (std::string &) |
| Print a line to the output stream. | |
| static bool | setStream (std::ostream *) |
| Set output stream. | |
Private Member Functions | |
| EventLog (const EventLog &e) throw () | |
| Copy constructor. | |
| EventLog () throw () | |
| Default constructor. | |
| void | operator= (const EventLog &e) |
| Assignment operator. | |
| ~EventLog () throw () | |
| Destructor. | |
Static Private Attributes | |
| static std::ostream * | out = NULL |
| Output stream. | |
|
|
Copy constructor.
Definition at line 99 of file eventlog.hpp. |
|
|
Assignment operator.
Definition at line 111 of file eventlog.hpp. |
|
|
|
Set output stream.
Definition at line 51 of file eventlog.cpp. References out. |
1.4.0