#include <Logger.h>
Classes | |
| class | IListener |
Public Member Functions | |
| Logger (void) | |
| virtual | ~Logger (void) |
| LogIterator | GetOldestLog () const |
| LogIterator | GetNewestLog () const |
| unsigned | GetLogLimit () const |
| unsigned | SetLogLimit (unsigned limit) |
| unsigned | GetLogCount () const |
| IListener * | GetListener () const |
| void | SetListener (IListener *listener) |
| LogIterator | Log (const cl7::string_type &message, const cl7::char_type *const file_name=NULL, const unsigned line_number=0) |
| LogIterator | Log (const cl7::string_type &message, const LogEntry::Type type, const cl7::char_type *const file_name=NULL, const unsigned line_number=0) |
Static Public Member Functions | |
| static Logger * | GetStandardLogger () |
| static void | SetStandardLogger (Logger *logger) |
The standard logger class. Holds a list of log entries which hold the log message itself and the log type (warning, error, etc.). If the number of log entries exceeds the log limit (default 1000) the oldest log entries are removed. The class provides a virtual function OnLog which is called after adding another log entry and derived classes may override.
| cl7::logging::Logger::Logger | ( | void | ) |
Default constructor.
Reimplemented in pl7::console::Logger, and xl7::logging::Logger.
| cl7::logging::Logger::~Logger | ( | void | ) | [virtual] |
Destructor.
Reimplemented in pl7::console::Logger, and xl7::logging::Logger.
| IListener* cl7::logging::Logger::GetListener | ( | ) | const [inline] |
Returns the log listener (or NULL).
| unsigned cl7::logging::Logger::GetLogCount | ( | ) | const [inline] |
Returns the actual number of log entries.
| unsigned cl7::logging::Logger::GetLogLimit | ( | ) | const [inline] |
Returns the maximal number of log entries.
| LogIterator cl7::logging::Logger::GetNewestLog | ( | ) | const [inline] |
Returns an iterator representing the newest log entry.
| LogIterator cl7::logging::Logger::GetOldestLog | ( | ) | const [inline] |
Returns an iterator representing the oldest log entry.
| static Logger* cl7::logging::Logger::GetStandardLogger | ( | ) | [inline, static] |
Returns the currently set standard logger object.
| LogIterator cl7::logging::Logger::Log | ( | const cl7::string_type & | message, | |
| const LogEntry::Type | type, | |||
| const cl7::char_type *const | file_name = NULL, |
|||
| const unsigned | line_number = 0 | |||
| ) |
Creates a new log entry with the given message and the given type. Oldest log entries are removed if necessary to satisfy the log limit.
| LogIterator cl7::logging::Logger::Log | ( | const cl7::string_type & | message, | |
| const cl7::char_type *const | file_name = NULL, |
|||
| const unsigned | line_number = 0 | |||
| ) |
Creates a new log entry with the given message and a default type (Log). Oldest log entries are removed if necessary to satisfy the log limit.
| void cl7::logging::Logger::SetListener | ( | IListener * | listener | ) | [inline] |
Sets the log listener (or NULL).
| unsigned cl7::logging::Logger::SetLogLimit | ( | unsigned | limit | ) |
Sets and returns the maximal number of log entries. Oldest log entries are removed if necessary.
| static void cl7::logging::Logger::SetStandardLogger | ( | Logger * | logger | ) | [inline, static] |
Sets the standard logger object. If the given pointer is NULL the default logger will be used as the currently set standard logger.
1.7.1