version 3.3

VRS::Logger Class Reference

Provides logging into a logfile with timestamps. More...

#include <vrs/logger.h>

Inheritance diagram for VRS::Logger:

VRS::SharedObj VRS::Visitable

List of all members.

Public Member Functions

void logInfo (const std::string &component, const std::string &message)
void logException (const std::string &component, const std::exception &exception)
void logException (const std::string &component, std::exception *exception)
void logError (int errortype, const char *expr, const char *file, int line, const char *text)

Static Public Member Functions

static SO< Loggerget ()
 Retrieves the instance of this singleton.
static void setLogFileLocation (const std::string &dir)
 The directory in which the log file(s) are placed.
static void setLogFilePrefix (const std::string &prefix)
 The prefix of the log file(s).
static void setLogFileExtension (const std::string &extension)
 The extension of the log file(s).
static void enableLogToConsole (bool enable)
 Enables/disables logging to the standard console By default this is turned off.


Detailed Description

Provides logging into a logfile with timestamps.

This class is a singleton, use the static method get() to retrieve the concrete singleton instance. The complete path of a log file is as follows:

<location>/<prefix>.<extension>

Use the methods setLogFileLocation(), setLogFilePrefix() an setLogFileExtension() to change the three strings.


Member Function Documentation

static SO<Logger> VRS::Logger::get (  )  [static]

Retrieves the instance of this singleton.

static void VRS::Logger::setLogFileLocation ( const std::string &  dir  )  [static]

The directory in which the log file(s) are placed.

The default location is the current working dir.

static void VRS::Logger::setLogFilePrefix ( const std::string &  prefix  )  [static]

The prefix of the log file(s).

The default prefix is 'vrs_log'.

static void VRS::Logger::setLogFileExtension ( const std::string &  extension  )  [static]

The extension of the log file(s).

The default extension is 'txt'.

static void VRS::Logger::enableLogToConsole ( bool  enable  )  [static]

Enables/disables logging to the standard console By default this is turned off.

void VRS::Logger::logInfo ( const std::string &  component,
const std::string &  message 
)

void VRS::Logger::logException ( const std::string &  component,
const std::exception &  exception 
)

void VRS::Logger::logException ( const std::string &  component,
std::exception *  exception 
)

void VRS::Logger::logError ( int  errortype,
const char *  expr,
const char *  file,
int  line,
const char *  text 
)


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

Generated on Mon May 21 06:00:19 2012 by Doxygen 1.5.6
© 2001-2010 Hasso-Plattner-Institut | Impressum | Contact