#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 () |
bool | isInLogLevel (int iLevel) |
int | getMinLogLevel () const |
bool | setMinLogLevel (int iLevel) |
int | getMaxLogLevel () const |
bool | setMaxLogLevel (int iLevel) |
int | getExtraLogLevel () const |
bool | setExtraLogLevel (int iLevel) |
char * | getHeader () |
bool | setHeader (char *str) |
bool | setHeader (int i1, int i2) |
bool | setOutputStream (ostream &os) |
Private Attributes | |
Timing | timing |
char | buf [MAX_LOG_LINE] |
int | iMinLogLevel |
int | iMaxLogLevel |
int | iExtraLogLevel |
char | strHeader [MAX_HEADER] |
ostream * | os |
Definition at line 94 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 66 of file Logger.C. References iMaxLogLevel, iMinLogLevel, os, Timing::restartTime(), strHeader, and timing. |
|
This method returns the extra log level. Message with a level that are equal to this value are always logged.
Definition at line 214 of file Logger.C. References iExtraLogLevel. |
|
This method returns the current header that is written before the actual text that has to be logged.
Definition at line 234 of file Logger.C. References strHeader. |
|
This method returns the maximal log level. Message with a level that are higher than this value are ignored when they are logged.
Definition at line 196 of file Logger.C. References iMaxLogLevel. Referenced by isInLogLevel(). |
|
This method returns the minimal log level. Message with a level that lies below this value are ignored when they are logged.
Definition at line 178 of file Logger.C. References iMinLogLevel. Referenced by isInLogLevel(). |
|
This method returns whether the supplied log level is recorded, thus within the interval [min_log_level..max_log_level] or equal to the extra log level.
Definition at line 169 of file Logger.C. References getMaxLogLevel(), getMinLogLevel(), and iExtraLogLevel. Referenced by log(), and logWithTime(). |
|
This method can be used to log information. Only when the specified level of the message lies in the range (iMinLogLevel..iMaxLogLevel) 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 103 of file Logger.C. References buf, isInLogLevel(), os, and strHeader. |
|
This method can be used to log information. Only when the specified level of the message lies in the range (iMinLogLevel..iMaxLogLevel) the information is logged. This method receives a a normal string
Definition at line 82 of file Logger.C. References isInLogLevel(), os, and strHeader. Referenced by Connection::Connection(). |
|
This method can be used to log information. Only when the specified level of the message lies in the range (iMinLogLevel..iMaxLogLevel) 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 134 of file Logger.C. References buf, isInLogLevel(), os, Timing::printTimeDiffWithText(), strHeader, and timing. |
|
This method restarts the timer associated with this Logger. Definition at line 159 of file Logger.C. References Timing::restartTime(), and timing. Referenced by main(). |
|
This method sets the maximal log level. Message with a level that are higher this value are ignored when they are logged.
Definition at line 223 of file Logger.C. References iExtraLogLevel. |
|
This method sets the header that is written before the actual text that has to be logged. The header is represented by two integers which are written between parentheses.
Definition at line 255 of file Logger.C. References strHeader. |
|
This method sets the header that is written before the actual text that has to be logged.
Definition at line 243 of file Logger.C. References strHeader. |
|
This method sets the maximal log level. Message with a level that are higher this value are ignored when they are logged.
Definition at line 205 of file Logger.C. References iMaxLogLevel. Referenced by main(). |
|
This method sets the minimal log level. Message with a level that lies below this value are ignored when they are logged.
Definition at line 187 of file Logger.C. References iMinLogLevel. Referenced by main(). |
|
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 266 of file Logger.C. References os. Referenced by main(). |
|
buffer needed by different methods Definition at line 97 of file Logger.h. Referenced by log(), and logWithTime(). |
|
extra log level to print information Definition at line 100 of file Logger.h. Referenced by getExtraLogLevel(), isInLogLevel(), and setExtraLogLevel(). |
|
maximal log level to print information Definition at line 99 of file Logger.h. Referenced by getMaxLogLevel(), Logger(), and setMaxLogLevel(). |
|
minimal log level to print information Definition at line 98 of file Logger.h. Referenced by getMinLogLevel(), Logger(), and setMinLogLevel(). |
|
output stream to print messages to Definition at line 102 of file Logger.h. Referenced by log(), Logger(), logWithTime(), and setOutputStream(). |
|
header string that is printed before msg Definition at line 101 of file Logger.h. Referenced by getHeader(), log(), Logger(), logWithTime(), and setHeader(). |
|
timer to print timing information Definition at line 96 of file Logger.h. Referenced by Logger(), logWithTime(), and restartTimer(). |