ContextRealLogger Class Reference

A real logging class. More...

#include <logging.h>

List of all members.

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.
ContextRealLoggeroperator<< (const ContextFeature &)
 Operator for appending features.
template<typename T>
ContextRealLoggeroperator<< (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


Detailed Description

A real logging class.

This is used by the actual macros to print messages.


Constructor & Destructor Documentation

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.


Member Function Documentation

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.

template<typename T>
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.


Member Data Documentation

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.

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]


The documentation for this class was generated from the following files:

Generated on Sun Apr 21 16:11:51 2013 for libcontextsubscriber by  doxygen 1.5.6