OpenAB  1.0.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
OpenAB::Logger Class Referenceabstract

Logger class, allows to override way in which messages from OpenAB will be logged. More...

#include <Log.hpp>

Inheritance diagram for OpenAB::Logger:
Collaboration diagram for OpenAB::Logger:

Public Types

enum  LogLevel {
  Fatal = 0, Error, Warning, Info,
  Verbose, DebugF, Debug
}
 

Public Member Functions

 Logger ()
 Default constructor. More...
 
virtual ~Logger ()
 Destructor, virtual by default. More...
 
template<typename T >
Loggeroperator<< (T data)
 
virtual Loggeroperator<< (std::ostream &(*pf)(std::ostream &))=0
 
Loggerget (LogLevel l)
 

Static Public Member Functions

static LogLevelOutLevel ()
 Returns currently set LogLevel and allows to override it. More...
 
static LoggergetDefaultLogger ()
 Returns pointer to currently set default logger. There can be only one default logger set at the time. More...
 
static void setDefaultLogger (Logger *logger)
 Sets new default logger. More...
 

Protected Member Functions

const char * toString (LogLevel l)
 

Protected Attributes

LogLevel level
 
std::ostringstream oss
 

Detailed Description

Logger class, allows to override way in which messages from OpenAB will be logged.

Member Enumeration Documentation

Enumerator
Fatal 

Fatal messages

Error 

Error messages

Warning 

Warning messages

Info 

Info messages

Verbose 

Verbose messages

DebugF 

Debug messages with current function name

Debug 

Debug messages

Constructor & Destructor Documentation

OpenAB::Logger::Logger ( )

Default constructor.

OpenAB::Logger::~Logger ( )
virtual

Destructor, virtual by default.

Member Function Documentation

Logger & OpenAB::Logger::get ( Logger::LogLevel  l)

Returns Logger reference set to print messages in given LogLevel.

Parameters
[in]llog level
Returns
reference to Logger
Logger * OpenAB::Logger::getDefaultLogger ( )
static

Returns pointer to currently set default logger. There can be only one default logger set at the time.

Returns
Pointer to currently set logger, or NULL if no logger was set.
template<typename T >
Logger& OpenAB::Logger::operator<< ( data)
inline
virtual Logger& OpenAB::Logger::operator<< ( std::ostream &(*)(std::ostream &)  pf)
pure virtual

Implemented in OpenAB::DefaultLogger.

Logger::LogLevel & OpenAB::Logger::OutLevel ( )
static

Returns currently set LogLevel and allows to override it.

Returns
reference to currently set LogLevel
void OpenAB::Logger::setDefaultLogger ( Logger logger)
static

Sets new default logger.

Parameters
[in]loggernew logger to be used as default one.
Note
OpenAB provides default logger that is used by default, until explicitly override by setDefaultLogger call.
const char * OpenAB::Logger::toString ( Logger::LogLevel  l)
protected

Member Data Documentation

LogLevel OpenAB::Logger::level
protected
std::ostringstream OpenAB::Logger::oss
protected

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