#include <debug.hh>
Definition at line 71 of file debug.hh.
[NOHEADER] | |
| void | init () |
| pthread_once_t | init_once = PTHREAD_ONCE_INIT |
Public Types | |
| enum | Level { lDebug = 0, lInfo, lMessage, lWarning, lError, lFatal } |
Public Member Functions | |
| DebugLogger (const char *loggerName) | |
| Level | getMinimumLevel () const |
| Returns the minimum level to log. | |
| void | logFatal (const char *fmt,...) |
| Logs a fatal error at high priority and exits. | |
| void | log (Level level, const char *fmt,...) |
| void | vlog (Level level, const char *fmt, va_list) |
Static Public Member Functions | |
| void | setFatalThrows (bool newValue) |
| Sets whether a fatal error should throw a FatalError (true) or abort (false, default). | |
Static Public Attributes | |
| const char * | LEVEL_NAMES [] |
Private Member Functions | |
| void | findLevel () const |
Private Attributes | |
| const char * | loggerName |
| bool | levelFound |
| If we've searched the configuration for our minimum level yet. | |
| Level | minimumLevel |
| Any logs below this level are surpressed. | |
Static Private Attributes | |
| bool | fatalThrows |
| std::map< std::string, Level > | levels |
| A map of logger names to levels. | |
| pthread_mutex_t | mutex = PTHREAD_MUTEX_INITIALIZER |
| Synchronizes access. | |
| const Level | DEFAULT_LEVEL = DebugLogger::lMessage |
| Default logging level. | |
|
|
Definition at line 76 of file debug.hh. Referenced by getMinimumLevel(), and init(). |
|
|
Definition at line 73 of file debug.hh. References levelFound, and loggerName. |
|
|
Definition at line 138 of file debug.cc. References DEFAULT_LEVEL, init_once, levelFound, levels, loggerName, minimumLevel, and NULL. Referenced by getMinimumLevel(), and vlog(). |
|
|
Returns the minimum level to log. This is useful when doing expensive work to prepare a log message. Definition at line 114 of file debug.cc. References findLevel(), Level, levelFound, minimumLevel, mutex, and atoms::write(). |
Here is the call graph for this function:

|
|
Definition at line 63 of file debug.cc. References std::getline(), std::ifstream, Level, LEVEL_NAMES, levels, loggerName, std::make_pair(), and NULL. |
Here is the call graph for this function:

|
||||||||||||||||
Here is the call graph for this function:

|
||||||||||||
Here is the call graph for this function:

|
|
Sets whether a fatal error should throw a FatalError (true) or abort (false, default). This is useful in unit tests to check if error-handling code is working properly. Otherwise, there's little reason to want an exception; they're called fatal errors for a reason. Definition at line 94 of file debug.hh. References fatalThrows. |
|
||||||||||||||||
|
Definition at line 171 of file debug.cc. References args, fatalThrows, findLevel(), LEVEL_NAMES, levelFound, lFatal, loggerName, minimumLevel, mutex, atoms::Backtrace::print(), and atoms::write(). Referenced by log(), and logFatal(). |
Here is the call graph for this function:

|
|
Default logging level.
Definition at line 40 of file debug.cc. Referenced by findLevel(). |
|
|
Definition at line 38 of file debug.cc. Referenced by setFatalThrows(), and vlog(). |
|
|
Definition at line 43 of file debug.cc. Referenced by findLevel(). |
|
|
Initial value: {
"debug",
"info",
"message",
"warning",
"error",
"fatal"
}
|
|
|
If we've searched the configuration for our minimum level yet.
Definition at line 142 of file debug.hh. Referenced by DebugLogger(), findLevel(), getMinimumLevel(), and vlog(). |
|
|
A map of logger names to levels.
Definition at line 42 of file debug.cc. Referenced by findLevel(), and init(). |
|
|
Definition at line 139 of file debug.hh. Referenced by DebugLogger(), findLevel(), init(), and vlog(). |
|
|
Any logs below this level are surpressed.
Definition at line 145 of file debug.hh. Referenced by findLevel(), getMinimumLevel(), and vlog(). |
|
|
Synchronizes access.
Definition at line 48 of file debug.cc. Referenced by getMinimumLevel(), and vlog(). |
1.3.5