#include <logging.h>
Public Member Functions | |
| ContextRealLogger (int msgType, const char *module, const char *func, const char *file, int line) | |
| Constructor. | |
| ~ContextRealLogger () | |
| Destructor, prints end-of-line before going down. | |
| ContextRealLogger & | operator<< (const ContextFeature &) |
| Operator for appending features. | |
| template<typename T> | |
| ContextRealLogger & | operator<< (const T &qSomething) |
Static Public Member Functions | |
| static void | initialize () |
| Initialize the class by checking the enviornment variables and setting the message output params. | |
Static Public Attributes | |
| static bool | showTest = true |
| Test messages enabled at runtime. | |
| static bool | showDebug = true |
| Debug messages enabled at runtime. | |
| static bool | showWarning = true |
| Warning messages enabled at runtime. | |
| static bool | showCritical = true |
| Critical messages enabled at runtime. | |
| static bool | initialized = false |
| Class initialized/env vars parsed. | |
| static bool | hideTimestamps = false |
| Don't print timestamps. | |
| static bool | useColor = false |
| Use simple colors for output (yellow for warnings, red for criticals). | |
| static char * | showModule = NULL |
| Show messages only from the specified module. | |
| static char * | hideModule = NULL |
| Hide messages from the specified module. | |
| static bool | vanilla = false |
| Use vanilla (stripped-down) logging. | |
Private Member Functions | |
| bool | shouldPrint () |
| void | appendFeatures () |
| Append (print) all the features, separated with commas and wrapped in brackets. | |
Private Attributes | |
| int | msgType |
| Type of message we're representing. | |
| const char * | moduleName |
| The module name. | |
| QString | data |
| Holds the stream data. | |
| QStringList | features |
This is used by the actual macros to print messages.
| ContextRealLogger::ContextRealLogger | ( | int | type, | |
| const char * | module, | |||
| const char * | func, | |||
| const char * | file, | |||
| int | line | |||
| ) |
Constructor.
Called by the macros. func is the function name, file is is the current source file and line specifies the line number.
| ContextRealLogger::~ContextRealLogger | ( | ) |
Destructor, prints end-of-line before going down.
| void ContextRealLogger::initialize | ( | ) | [static] |
Initialize the class by checking the enviornment variables and setting the message output params.
The log level is set from CONTEXT_LOG_VERBOSITY and from this env var the showTest, showDebug, showWarning... are set. By default everything is displayed at runtime. It's also possible to not show timestamps in messages and spice-up the output with some color.
| ContextRealLogger & ContextRealLogger::operator<< | ( | const ContextFeature & | f | ) |
Operator for appending features.
| ContextRealLogger& ContextRealLogger::operator<< | ( | const T & | qSomething | ) | [inline] |
| bool ContextRealLogger::shouldPrint | ( | ) | [private] |
| void ContextRealLogger::appendFeatures | ( | ) | [private] |
Append (print) all the features, separated with commas and wrapped in brackets.
bool ContextRealLogger::showTest = true [static] |
Test messages enabled at runtime.
bool ContextRealLogger::showDebug = true [static] |
Debug messages enabled at runtime.
bool ContextRealLogger::showWarning = true [static] |
Warning messages enabled at runtime.
bool ContextRealLogger::showCritical = true [static] |
Critical messages enabled at runtime.
bool ContextRealLogger::initialized = false [static] |
Class initialized/env vars parsed.
bool ContextRealLogger::hideTimestamps = false [static] |
Don't print timestamps.
bool ContextRealLogger::useColor = false [static] |
Use simple colors for output (yellow for warnings, red for criticals).
char * ContextRealLogger::showModule = NULL [static] |
Show messages only from the specified module.
char * ContextRealLogger::hideModule = NULL [static] |
Hide messages from the specified module.
bool ContextRealLogger::vanilla = false [static] |
Use vanilla (stripped-down) logging.
int ContextRealLogger::msgType [private] |
Type of message we're representing.
const char* ContextRealLogger::moduleName [private] |
The module name.
QString ContextRealLogger::data [private] |
Holds the stream data.
QStringList ContextRealLogger::features [private] |
1.5.6