Logging facility. More...
|void||insert (ILogOutputter *adopted, bool alwaysAtHead=false)|
|Add an outputter to the head of the list. |
|void||remove (ILogOutputter *orphaned)|
|Remove an outputter from the list. |
|void||pop_front (bool alwaysAtHead=false)|
|Remove the outputter from the head of the list. |
|bool||setFilter (const char *name)|
|Set the minimum priority filter. |
|Set the minimum priority filter (by ordinal). |
|void||print (const char *file, int line, const char *format,...)|
|Print a log message. |
|int||getFilter () const|
|Get the minimum priority level. |
|const char *||getFilterName () const|
|Get the filter name of the current filter level. |
|const char *||getFilterName (int level) const|
|Get the filter name of a specified filter level. |
|int||getConsoleMaxLevel () const|
|Get the console filter level (messages above this are not sent to console). |
|static CLog *||getInstance ()|
|Get the singleton instance of the log. |
The logging class; all console output should go through this class. It supports multithread safe operation, several message priority levels, filtering by priority, and output redirection. The macros LOG() and LOGC() provide convenient access.
|void CLog::insert||(||ILogOutputter *||adopted,|
|bool|| alwaysAtHead = |
Add an outputter to the head of the list.
Inserts an outputter to the head of the outputter list. When the logger writes a message, it goes to the outputter at the head of the outputter list. If that outputter's
write() method returns true then it also goes to the next outputter, as so on until an outputter returns false or there are no more outputters. Outputters still in the outputter list when the log is destroyed will be deleted. If
alwaysAtHead is true then the outputter is always called before all outputters with
alwaysAtHead false and the return value of the outputter is ignored.
By default, the logger has one outputter installed which writes to the console.
|void CLog::pop_front||(||bool|| alwaysAtHead =
|void CLog::print||(||const char *||file,|
|const char *||format,|
|void CLog::remove||(||ILogOutputter *||orphaned||)|
|bool CLog::setFilter||(||const char *||name||)|
Set the minimum priority filter.
Set the filter. Messages below this priority are discarded. The default priority is 4 (INFO) (unless built without NDEBUG in which case it's 5 (DEBUG)). setFilter(const char*) returns true if the priority
name was recognized; if
name is NULL then it simply returns true.