Drag[en]gine Game Engine  1.0
deLoggerBuffer Class Reference

Logger buffer. More...

#include <deLoggerBuffer.h>

Inheritance diagram for deLoggerBuffer:
deLogger deObject

Classes

struct  sEntry
 Logger buffer entry. More...
 

Public Types

enum  eMessageTypes { emtInfo, emtWarn, emtError }
 Message types. More...
 

Public Member Functions

Management
int GetEntryCount ()
 Number of entries. More...
 
sEntry GetEntryAt (int index)
 Copy of entry at index. More...
 
void AddEntry (eMessageTypes type, const decString &source, const decString &message)
 Add entry. More...
 
void Clear ()
 Clear buffer. More...
 
void SendToLogger (deLogger &logger)
 Send messages in the buffer to a logger and clear the buffer afterwards. 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

 deLoggerBuffer ()
 Create logger buffer. More...
 
virtual ~deLoggerBuffer ()
 Clean up logger buffer. More...
 

Detailed Description

Logger buffer.

Buffers messages to send them at a later time to another logger. Allows for example collecting log messages in parallel tasks and sending them to a main thread logger during synchronization time. The logger buffer is not thread safe. It only provides a simple to use buffer for log messages.

Note
Logger buffer is thread safe.

Member Enumeration Documentation

◆ eMessageTypes

Message types.

Enumerator
emtInfo 

Information.

emtWarn 

Warning.

emtError 

Error.

Constructor & Destructor Documentation

◆ deLoggerBuffer()

deLoggerBuffer::deLoggerBuffer ( )

Create logger buffer.

◆ ~deLoggerBuffer()

virtual deLoggerBuffer::~deLoggerBuffer ( )
protectedvirtual

Clean up logger buffer.

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

◆ AddEntry()

void deLoggerBuffer::AddEntry ( eMessageTypes  type,
const decString source,
const decString message 
)

Add entry.

◆ Clear()

void deLoggerBuffer::Clear ( )

Clear buffer.

◆ GetEntryAt()

sEntry deLoggerBuffer::GetEntryAt ( int  index)

Copy of entry at index.

◆ GetEntryCount()

int deLoggerBuffer::GetEntryCount ( )

Number of entries.

◆ GetMutex()

deMutex& deLoggerBuffer::GetMutex ( )
inlineprotected

◆ LogError()

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

Log error message.

Reimplemented from deLogger.

◆ LogInfo()

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

Log information message.

Reimplemented from deLogger.

◆ LogWarn()

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

Log warning message.

Reimplemented from deLogger.

◆ SendToLogger()

void deLoggerBuffer::SendToLogger ( deLogger logger)

Send messages in the buffer to a logger and clear the buffer afterwards.


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