#include <Logger.h>
Collaboration diagram for Logger:
Public Methods | |
Logger (ostream &os=cout, int iMinLogLevel=0, int iMaxLogLevel=0) | |
bool | log (int iLevel, string str) |
bool | log (int i, char *str,...) |
bool | logWithTime (int iLevel, char *str,...) |
void | restartTimer () |
Timing | getTiming () |
bool | isInLogLevel (int iLevel) |
bool | addLogLevel (int iLevel) |
bool | addLogRange (int iMin, int iMax) |
char * | getHeader () |
bool | setHeader (char *str) |
bool | setHeader (int i1, int i2) |
bool | setOutputStream (ostream &os) |
ostream & | getOutputStream () |
void | showLogLevels (ostream &os) |
Private Attributes | |
Timing | m_timing |
char | m_buf [MAX_LOG_LINE] |
set< int > | m_setLogLevels |
char | m_strHeader [MAX_HEADER] |
ostream * | m_os |
Definition at line 101 of file Logger.h.
|
This is the constructor for the Logger. The output stream, the minimal and maximal log level can all be specified. The timer in this class is also restarted.
Definition at line 70 of file Logger.C. References m_os, m_strHeader, m_timing, and Timing::restartTime(). |
|
This method inserts the log level 'iLevel' to the set of logged levels. Information from this log level will be printed.
Definition at line 187 of file Logger.C. References m_setLogLevels. Referenced by addLogRange(), and main(). |
|
This method inserts all the log levels in the interval [iMin..iMax] to the set of logged levels.
Definition at line 198 of file Logger.C. References addLogLevel(). Referenced by main(). |
|
This method returns the current header that is written before the actual text that has to be logged.
Definition at line 209 of file Logger.C. References m_strHeader. |
|
This method returns the output stream to which the log information is written. This outputstream can be standard output (cout) or a reference to a file.
Definition at line 250 of file Logger.C. References m_os. |
|
Return the instance of the timing class that denotes the time the counter is running. Definition at line 168 of file Logger.C. References m_timing. |
|
This method returns whether the supplied log level is recorded, thus whether it is part of the set of logged levels.
Definition at line 178 of file Logger.C. References m_setLogLevels. Referenced by log(), and logWithTime(). |
|
This method can be used to log information. Only when the specified level of the message is part of the set of logged values the information is logged. This method receives a character string that may contain format specifiers that are also available to 'printf' (like d, f, etc.). The remaining arguments are the variables that have to be filled in at the location of the specifiers.
Definition at line 105 of file Logger.C. References isInLogLevel(), m_buf, m_os, and m_strHeader. |
|
This method can be used to log information. Only when the specified level of the message is part of the set of logged levels the information is logged. This method receives a a normal string that is logged.
Definition at line 84 of file Logger.C. References isInLogLevel(), m_os, and m_strHeader. Referenced by Connection::Connection(). |
|
This method can be used to log information. Only when the specified level of the message is an element in the set of logged levels the information is logged. This method receives a character string that may contain format specifiers that are also available to 'printf' (like d, f, etc.). The remaining arguments are the variables that have to be filled in at the location of the specifiers. Before the logged message the elapsed time since the timer has been restarted is printed.
Definition at line 136 of file Logger.C. References isInLogLevel(), m_buf, m_os, m_strHeader, m_timing, and Timing::printTimeDiffWithText(). |
|
This method restarts the timer associated with this Logger. Definition at line 161 of file Logger.C. References m_timing, and Timing::restartTime(). Referenced by main(). |
|
This method sets a predefined header that is written before the actual logging text. The header is represented by two integers which are written between parentheses, i.e. (9, 2401).
Definition at line 229 of file Logger.C. References m_strHeader. |
|
This method sets the header that is written before the actual logging text.
Definition at line 217 of file Logger.C. References m_strHeader. |
|
This method sets the output stream to which the log information is written. This outputstream can be standard output (cout) or a reference to a file.
Definition at line 240 of file Logger.C. References m_os. Referenced by main(). |
|
This method outputs all the log levels that are logged to the output stream os.
Definition at line 258 of file Logger.C. References m_setLogLevels. |
|
buffer needed by different methods Definition at line 104 of file Logger.h. Referenced by log(), and logWithTime(). |
|
output stream to print messages to Definition at line 107 of file Logger.h. Referenced by getOutputStream(), log(), Logger(), logWithTime(), and setOutputStream(). |
|
set that contains all log levels Definition at line 105 of file Logger.h. Referenced by addLogLevel(), isInLogLevel(), and showLogLevels(). |
|
header string printed before msg Definition at line 106 of file Logger.h. Referenced by getHeader(), log(), Logger(), logWithTime(), and setHeader(). |
|
timer to print timing information Definition at line 103 of file Logger.h. Referenced by getTiming(), Logger(), logWithTime(), and restartTimer(). |