fluidvis
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
sx::Logger Class Referenceabstract

#include <Log4SX.h>

Inheritance diagram for sx::Logger:
sx::ConsoleLogger sx::FileLogger sx::ListLogger

Public Member Functions

virtual EXL ~Logger ()
 
EXL void setMinLevel (LogLevel level)
 
EXL LogLevel getMinLevel () const
 
EXL LogLevel getLevel () const
 
virtual EXL Loggeroperator<< (const Level l)
 
virtual EXL Loggeroperator<< (const LogMarkup m)=0
 
virtual EXL Loggeroperator<< (const Annotation a)=0
 
virtual EXL Loggeroperator<< (char value)=0
 
virtual EXL Loggeroperator<< (unsigned char value)=0
 
virtual EXL Loggeroperator<< (short value)=0
 
virtual EXL Loggeroperator<< (unsigned short value)=0
 
virtual EXL Loggeroperator<< (int value)=0
 
virtual EXL Loggeroperator<< (unsigned int value)=0
 
virtual EXL Loggeroperator<< (long value)=0
 
virtual EXL Loggeroperator<< (unsigned long value)=0
 
virtual EXL Loggeroperator<< (float value)=0
 
virtual EXL Loggeroperator<< (double value)=0
 
virtual EXL Loggeroperator<< (string value)=0
 

Static Public Member Functions

static EXL string newLine ()
 
static EXL void addLogger (string ID, Logger *logger)
 
static EXL void setDefaultLogger (string ID)
 
static EXL Loggerget ()
 
static EXL void deleteLogger (string ID)
 

Protected Member Functions

EXL Logger ()
 
bool takeMessage () const
 

Protected Attributes

LogLevel minLevel
 
LogLevel level
 

Detailed Description

A Logger base class. The base types, and string objects can be passed to the Logger as messages. Messages are only passed to the logger, iff the minLevel is not higher than level, and minLevel is different from L_NONE. Otherwise the messages are simply ignored. Passing a message <message> to the Logger <logger> at LogLevel <loglevel> would look like <logger> << Level(<loglevel>) << <message>;

Constructor & Destructor Documentation

EXL sx::Logger::Logger ( )
protected

default constructor, not used, because Logger is abstract

virtual EXL sx::Logger::~Logger ( )
virtual

deconstructor

Member Function Documentation

static EXL void sx::Logger::addLogger ( string  ID,
Logger logger 
)
static

Adds a logger with identifyer ID to the loggers map. If another logger with the same ID exists already, or the pointer logger has value 0, an exception is thrown.

Parameters
IDunique identifyer of the logger
loggera new logger, must not be 0
Exceptions
anexception of type Exception is thrown, if another logger has identifyer ID
static EXL void sx::Logger::deleteLogger ( string  ID)
static

Deletes the logger with identifyer ID. If no logger with identifyer ID exists, an exception is thrown.

Parameters
IDidentifyer of logger, which should be deleted
Exceptions
exceptionof type Exception is thrown, if an error occurs
static EXL Logger& sx::Logger::get ( )
static

Returns the default logger. A valid default logger must always exist.

Returns
reference of the default logger
EXL LogLevel sx::Logger::getLevel ( ) const

getter

EXL LogLevel sx::Logger::getMinLevel ( ) const

getter

static EXL string sx::Logger::newLine ( )
static

returns newline

virtual EXL Logger& sx::Logger::operator<< ( const Level  l)
virtual

Changes the minLevel of the logger to l. The following messages are ignored, if l is L_NONE or greater than level.

Parameters
lnew level of the logger
Returns
a reference to this object

Reimplemented in sx::FileLogger, sx::ListLogger, and sx::ConsoleLogger.

virtual EXL Logger& sx::Logger::operator<< ( const LogMarkup  m)
pure virtual

Appends a new LogMarkup to the Logger. Each new Message passed to the logger is part of the new markup. Markups are passed to the log independently from the values of level and minLevel.

Parameters
mnew LogMarkup
Returns
a reference to this object

Implemented in sx::FileLogger, sx::ListLogger, and sx::ConsoleLogger.

virtual EXL Logger& sx::Logger::operator<< ( const Annotation  a)
pure virtual

Appends a new Annotation to the Logger. Annotation should be used to document the messages passed to the logger. Annotations are passed to the log independently from the values of level and minLevel.

Parameters
aAnnotation
Returns
a reference to this object

Implemented in sx::FileLogger, sx::ListLogger, and sx::ConsoleLogger.

virtual EXL Logger& sx::Logger::operator<< ( char  value)
pure virtual

Passes a message to the logger, and returns a reference to the logger.

Implemented in sx::FileLogger, sx::ListLogger, and sx::ConsoleLogger.

virtual EXL Logger& sx::Logger::operator<< ( unsigned char  value)
pure virtual

Passes a message to the logger, and returns a reference to the logger.

Implemented in sx::FileLogger, sx::ListLogger, and sx::ConsoleLogger.

virtual EXL Logger& sx::Logger::operator<< ( short  value)
pure virtual

Passes a message to the logger, and returns a reference to the logger.

Implemented in sx::FileLogger, sx::ListLogger, and sx::ConsoleLogger.

virtual EXL Logger& sx::Logger::operator<< ( unsigned short  value)
pure virtual

Passes a message to the logger, and returns a reference to the logger.

Implemented in sx::FileLogger, sx::ListLogger, and sx::ConsoleLogger.

virtual EXL Logger& sx::Logger::operator<< ( int  value)
pure virtual

Passes a message to the logger, and returns a reference to the logger.

Implemented in sx::FileLogger, sx::ListLogger, and sx::ConsoleLogger.

virtual EXL Logger& sx::Logger::operator<< ( unsigned int  value)
pure virtual

Passes a message to the logger, and returns a reference to the logger.

Implemented in sx::FileLogger, sx::ListLogger, and sx::ConsoleLogger.

virtual EXL Logger& sx::Logger::operator<< ( long  value)
pure virtual

Passes a message to the logger, and returns a reference to the logger.

Implemented in sx::FileLogger, sx::ListLogger, and sx::ConsoleLogger.

virtual EXL Logger& sx::Logger::operator<< ( unsigned long  value)
pure virtual

Passes a message to the logger, and returns a reference to the logger.

Implemented in sx::FileLogger, sx::ListLogger, and sx::ConsoleLogger.

virtual EXL Logger& sx::Logger::operator<< ( float  value)
pure virtual

Passes a message to the logger, and returns a reference to the logger.

Implemented in sx::FileLogger, sx::ListLogger, and sx::ConsoleLogger.

virtual EXL Logger& sx::Logger::operator<< ( double  value)
pure virtual

Passes a message to the logger, and returns a reference to the logger.

Implemented in sx::FileLogger, sx::ListLogger, and sx::ConsoleLogger.

virtual EXL Logger& sx::Logger::operator<< ( string  value)
pure virtual

Passes a message to the logger, and returns a reference to the logger.

Implemented in sx::FileLogger, sx::ListLogger, and sx::ConsoleLogger.

static EXL void sx::Logger::setDefaultLogger ( string  ID)
static

Makes the logger with identifyer ID to the default logger. An exception is thrown, if a logger with identifyer ID does not exist.

Parameters
IDidentifyer of the default logger
Exceptions
exceptionof type Exception is thrown, if an error occurs
EXL void sx::Logger::setMinLevel ( LogLevel  level)

setter

bool sx::Logger::takeMessage ( ) const
protected

returns true, if messages are not be ignored by the logger

Member Data Documentation

LogLevel sx::Logger::level
protected

level required to be equal or greater than minLevel, if messages should not be ignored

LogLevel sx::Logger::minLevel
protected

minimum level the property level is required to be, if messages should not be ignored. If minLevel equals L_NONE, all messages are ignored.


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