Drag[en]gine Game Engine  1.0
deLogger Class Reference

Base logger class for all loggers. More...

#include <deLogger.h>

Inheritance diagram for deLogger:
deObject deLoggerBuffer deLoggerChain deLoggerConsole deLoggerConsoleColor deLoggerFile

Public Member Functions

Management
virtual void LogInfo (const char *source, const char *message)
 Log information message. More...
 
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 LogWarn (const char *source, const char *message)
 Log warning 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 LogError (const char *source, const char *message)
 Log error 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...
 
- 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...
 

Constructors and Destructors

 deLogger ()
 Creates logger. More...
 
virtual ~deLogger ()
 Clean up logger. More...
 

Additional Inherited Members

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

Detailed Description

Base logger class for all loggers.

To help sub-classes the formatted version provide a default implementation. forwarding a formatted text to the basic logger functions. In general this is the best solution. Sub classes can though overwrite these functions if they want to handle the formatting themselves.

Note
Loggers are thread safe. See subclass for potential restrictions.

Constructor & Destructor Documentation

◆ deLogger()

deLogger::deLogger ( )

Creates logger.

◆ ~deLogger()

virtual deLogger::~deLogger ( )
protectedvirtual

Clean up 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

◆ LogError()

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

Log error message.

Reimplemented in deLoggerConsoleColor, deLoggerBuffer, deLoggerChain, deLoggerFile, and deLoggerConsole.

◆ LogErrorFormat()

virtual void deLogger::LogErrorFormat ( const char *  source,
const char *  message,
  ... 
)
virtual

Log formated error message.

The default implementation builds a decString with the formatted string handling it over to LogError.

◆ LogErrorFormatUsing()

virtual void deLogger::LogErrorFormatUsing ( const char *  source,
const char *  message,
va_list  args 
)
virtual

Log formated error message.

The default implementation builds a decString with the formatted string handling it over to LogError.

◆ LogException()

virtual void deLogger::LogException ( const char *  source,
const deException exception 
)
virtual

Log exception error message.

The default implementation builds a decString with the formatted string handling it over to LogError. The string is formatted as "exception(file:line): message (description)" if description is not an empty string or "exception(file:line): message" otherwise.

◆ LogInfo()

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

Log information message.

Reimplemented in deLoggerConsoleColor, deLoggerBuffer, deLoggerChain, deLoggerFile, and deLoggerConsole.

◆ LogInfoFormat()

virtual void deLogger::LogInfoFormat ( const char *  source,
const char *  message,
  ... 
)
virtual

Log formatted information message.

The default implementation builds a decString with the formatted string handling it over to LogInfo.

◆ LogInfoFormatUsing()

virtual void deLogger::LogInfoFormatUsing ( const char *  source,
const char *  message,
va_list  args 
)
virtual

Log formatted information message.

The default implementation builds a decString with the formatted string handling it over to LogInfo.

◆ LogWarn()

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

Log warning message.

Reimplemented in deLoggerConsoleColor, deLoggerBuffer, deLoggerChain, deLoggerFile, and deLoggerConsole.

◆ LogWarnFormat()

virtual void deLogger::LogWarnFormat ( const char *  source,
const char *  message,
  ... 
)
virtual

Log formated warning message.

The default implementation builds a decString with the formatted string handling it over to LogWarn.

◆ LogWarnFormatUsing()

virtual void deLogger::LogWarnFormatUsing ( const char *  source,
const char *  message,
va_list  args 
)
virtual

Log formated warning message.

The default implementation builds a decString with the formatted string handling it over to LogWarn.


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