Public Member Functions | Static Public Member Functions | Static Public Attributes

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.

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.

template<typename T >
ContextRealLogger& ContextRealLogger::operator<< ( const T &  qSomething  )  [inline]
ContextRealLogger & ContextRealLogger::operator<< ( const ContextFeature f  ) 

Operator for appending features.


Member Data Documentation

char * ContextRealLogger::hideModule = NULL [static]

Hide messages from the specified module.

bool ContextRealLogger::hideTimestamps = false [static]

Don't print timestamps.

bool ContextRealLogger::initialized = false [static]

Class initialized/env vars parsed.

bool ContextRealLogger::showCritical = true [static]

Critical messages enabled at runtime.

bool ContextRealLogger::showDebug = true [static]

Debug messages enabled at runtime.

char * ContextRealLogger::showModule = NULL [static]

Show messages only from the specified module.

bool ContextRealLogger::showTest = true [static]

Test messages enabled at runtime.

bool ContextRealLogger::showWarning = true [static]

Warning messages enabled at runtime.

bool ContextRealLogger::useColor = false [static]

Use simple colors for output (yellow for warnings, red for criticals).

bool ContextRealLogger::vanilla = false [static]

Use vanilla (stripped-down) logging.


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