automotive-message-broker  0.14.803
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
CUtil::Logger Class Reference

Simple logger to log messages on file and console. More...

#include <logger.h>

Public Types

enum  Level {
  EError = 0, EWarning, EMessage, EInfo,
  ETrace, EDebug
}
 
typedef loggerConf_ loggerConf
 

Public Member Functions

void print (const unsigned int verbosityLevel, const std::string &sourceFile, const int codeLine, const std::string &message)
 
void configure (const std::string &outputFile, const loggerConf configuration, const int fileVerbosityLevel, const int screenVerbosityLevel)
 
void flush ()
 

Static Public Member Functions

static LoggergetInstance ()
 

Static Public Attributes

static const loggerConf file_on = L_nofile_
 
static const loggerConf file_off = L_file_
 
static const loggerConf screen_on = L_noscreen_
 
static const loggerConf screen_off = L_screen_
 

Detailed Description

Simple logger to log messages on file and console.

This is the implementation of a simple logger in C++. It is implemented as a Singleton, so it can be easily called through two DEBUG macros. It is Pthread-safe. It allows to log on both file and screen, and to specify a verbosity threshold for both of them.

Member Typedef Documentation

typedef loggerConf_ CUtil::Logger::loggerConf

Type used for the configuration

Member Enumeration Documentation

Logging level

Member Function Documentation

void CUtil::Logger::flush ( )
inline

Flush output buffer

Member Data Documentation

const loggerConf CUtil::Logger::file_off = L_file_
static

Enable logging to file

const loggerConf CUtil::Logger::file_on = L_nofile_
static

Disable logging to file

const loggerConf CUtil::Logger::screen_off = L_screen_
static

Disable logging to screen

const loggerConf CUtil::Logger::screen_on = L_noscreen_
static

Enable logging to screen


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