#include <Logger.h>
Static Public Member Functions | |
static int | getLogLevel () |
Accessor method. | |
static void | setLogLevel (int dl) |
Accessor method for setting the logging level. | |
static void | setLogFile (ofstream *ost) |
Sets the output stream to which to direct the logging. | |
static void | log (string s) |
Logs the passed message to the stream, and to standard output. | |
static void | indent () |
Handle indenting to the current callDepth: Logs two spaces, callDepth times. | |
static void | incCallDepth () |
Increments the call depth. | |
static void | decCallDepth () |
Decrements the call depth. | |
Static Public Attributes | |
static int | logLevel = 0 |
The desired verbosity level - if 0, no logging is done. | |
static ofstream * | logFile = 0 |
The output file stream to which the logging is sent. | |
static int | callDepth = 0 |
How deep in the call tree we are - determines indenting. |
All messages are sent to standard output, in addition to any specified log file. The class tracks two scalars: the logLevel is the desired level of verbosity (each log message has an associated logLevel that the class' logLevel is compared to). In addition, callDepth can be increased or decreased by the user, and it controls the indenting of messages. By controlling callDepth, the user can control the formatting of logging. The header defines a series of macros that simplify the task of working with the Logger class. The default is to do no logging. If you don't want to incur the small overhead of logging, it can be turned off with the NLOG compilation flag, assuming that logging is done via the provided macros.
|
Decrements the call depth.
|
|
Accessor method.
|
|
Increments the call depth.
|
|
Handle indenting to the current callDepth: Logs two spaces, callDepth times.
|
|
Logs the passed message to the stream, and to standard output. Note that comparing the message's log level to the system logLevel is up to the user, but that the Logger.h header provides utility macros to handle that.
|
|
Sets the output stream to which to direct the logging.
|
|
Accessor method for setting the logging level.
|
|
How deep in the call tree we are - determines indenting.
|
|
The output file stream to which the logging is sent.
|
|
The desired verbosity level - if 0, no logging is done.
|