Lunchbox
1.17.0
Multi-threaded C++ toolbox library for all application developers creating high-performance multi-threaded programs.
|
The logging class. More...
#include <log.h>
Public Member Functions | |
void | indent () |
Indent subsequent log output by one level. More... | |
void | exdent () |
Un-indent subsequent log output by one level. More... | |
void | disableFlush () |
Disable flushing of the log on endl. More... | |
void | enableFlush () |
Re-enable flushing of the log on endl. More... | |
void | forceFlush () |
Flush all buffered log data. More... | |
void | disableHeader () |
Disable prefix printing for subsequent new lines. More... | |
void | enableHeader () |
Re-enable prefix printing for subsequent new lines. More... | |
void | setThreadName (const std::string &name) |
const std::string & | getThreadName () const |
Static Public Member Functions | |
static Log & | instance () |
The per-thread logger. More... | |
static Log & | instance (const char *file, const int line) |
The per-thread logger. More... | |
static void | exit () |
Exit the log instance for the current thread. More... | |
static void | reset () |
static std::string & | getLogLevelString () |
The string representation of the current log level. More... | |
static int | getLogLevel (const char *level) |
static void | setOutput (std::ostream &stream) |
Change the output stream. More... | |
static bool | setOutput (const std::string &file) |
Change the output stream to the given file. More... | |
static std::ostream & | getOutput () |
Get the current output stream. | |
static void | setClock (Clock *clock) |
Set the reference clock. More... | |
static const Clock & | getClock () |
Static Public Attributes | |
static int | level |
The current log level. More... | |
static unsigned | topics |
The current log topics. More... | |
Friends | |
template<class T > | |
void | perThreadDelete (T *) |
Default PerThread destructor deleting the object. More... | |
The logging class.
Should be accessed through the LBVERB, LBDEBUG, LBINFO, LBERROR and LBLOG macros, which manage per-thread instances and their invocation state.
void lunchbox::Log::disableFlush | ( | ) |
Disable flushing of the log on endl.
void lunchbox::Log::disableHeader | ( | ) |
Disable prefix printing for subsequent new lines.
void lunchbox::Log::enableFlush | ( | ) |
Re-enable flushing of the log on endl.
void lunchbox::Log::enableHeader | ( | ) |
Re-enable prefix printing for subsequent new lines.
void lunchbox::Log::exdent | ( | ) |
Un-indent subsequent log output by one level.
|
static |
Exit the log instance for the current thread.
void lunchbox::Log::forceFlush | ( | ) |
Flush all buffered log data.
|
static |
|
static |
The string representation of the current log level.
void lunchbox::Log::indent | ( | ) |
Indent subsequent log output by one level.
|
static |
The per-thread logger.
Referenced by lunchbox::Referenced::ref().
|
static |
The per-thread logger.
|
static |
Set the reference clock.
The clock will be used instantly by all log outputs. Use 0 to reset the clock to the default clock.
clock | the reference clock. |
|
static |
Change the output stream.
|
static |
Change the output stream to the given file.
|
friend |
Default PerThread destructor deleting the object.
Definition at line 34 of file perThread.h.