Drag[en]gine Game Engine  1.0
deLoggerChain Class Reference

Logs messages to a list of other loggers. More...

#include <deLoggerChain.h>

Inheritance diagram for deLoggerChain:
deLogger deObject

Public Member Functions

Management
int GetLoggerCount ()
 Number of loggers in the chain. More...
 
deLoggerGetLoggerAt (int index)
 Logger at position. More...
 
void AddLogger (deLogger *logger)
 Add logger to chain. More...
 
void RemoveLogger (deLogger *logger)
 Remove logger from chain. More...
 
void RemoveAllLoggers ()
 Remove all logger from chain. More...
 
virtual void LogInfo (const char *source, const char *message)
 Log information message. More...
 
virtual void LogWarn (const char *source, const char *message)
 Log warning message. More...
 
virtual void LogError (const char *source, const char *message)
 Log error message. More...
 
- Public Member Functions inherited from deLogger
virtual void LogInfoFormat (const char *source, const char *message,...)
 Log formatted information message. More...
 
virtual void LogInfoFormatUsing (const char *source, const char *message, va_list args)
 Log formatted information message. More...
 
virtual void LogWarnFormat (const char *source, const char *message,...)
 Log formated warning message. More...
 
virtual void LogWarnFormatUsing (const char *source, const char *message, va_list args)
 Log formated warning message. More...
 
virtual void LogErrorFormat (const char *source, const char *message,...)
 Log formated error message. More...
 
virtual void LogErrorFormatUsing (const char *source, const char *message, va_list args)
 Log formated error message. More...
 
virtual void LogException (const char *source, const deException &exception)
 Log exception error message. More...
 
 deLogger ()
 Creates logger. More...
 
- Public Member Functions inherited from deObject
int GetRefCount () const
 Reference count. More...
 
void AddReference ()
 Add reference increasing reference count by 1. More...
 
void FreeReference ()
 Decrease reference count by one and delete object if count reaches 0. More...
 
 deObject ()
 Create object with reference count of 1. More...
 

Protected Member Functions

deMutexGetMutex ()
 
- Protected Member Functions inherited from deLogger
virtual ~deLogger ()
 Clean up logger. More...
 
- Protected Member Functions inherited from deObject
virtual ~deObject ()
 Clean up object. More...
 

Constructors and Destructors

 deLoggerChain ()
 Create chain logger. More...
 
virtual ~deLoggerChain ()
 Clean up chain logger. More...
 

Detailed Description

Logs messages to a list of other loggers.

Useful to log a message in more than one place for example on the console and in a file.

Note
Logger chain is thread safe for logging. It is not thread safe to change the logger layout while the logger is in active use due to deObject reference counting not being thread safe.

Constructor & Destructor Documentation

◆ deLoggerChain()

deLoggerChain::deLoggerChain ( )

Create chain logger.

◆ ~deLoggerChain()

virtual deLoggerChain::~deLoggerChain ( )
protectedvirtual

Clean up chain logger.

Note
Subclasses should set their destructor protected too to avoid users accidently deleting a reference counted object through the object pointer. Only FreeReference() is allowed to delete the object.

Member Function Documentation

◆ AddLogger()

void deLoggerChain::AddLogger ( deLogger logger)

Add logger to chain.

◆ GetLoggerAt()

deLogger* deLoggerChain::GetLoggerAt ( int  index)

Logger at position.

◆ GetLoggerCount()

int deLoggerChain::GetLoggerCount ( )

Number of loggers in the chain.

◆ GetMutex()

deMutex& deLoggerChain::GetMutex ( )
inlineprotected

◆ LogError()

virtual void deLoggerChain::LogError ( const char *  source,
const char *  message 
)
virtual

Log error message.

Reimplemented from deLogger.

◆ LogInfo()

virtual void deLoggerChain::LogInfo ( const char *  source,
const char *  message 
)
virtual

Log information message.

Reimplemented from deLogger.

◆ LogWarn()

virtual void deLoggerChain::LogWarn ( const char *  source,
const char *  message 
)
virtual

Log warning message.

Reimplemented from deLogger.

◆ RemoveAllLoggers()

void deLoggerChain::RemoveAllLoggers ( )

Remove all logger from chain.

◆ RemoveLogger()

void deLoggerChain::RemoveLogger ( deLogger logger)

Remove logger from chain.


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