Main Page Modules Namespaces C++ Classes Compound List File List Index
TNL::LogConsumer class Reference

TNL::LogConsumer Class Reference

#include <tnlLog.h>


Detailed Description

LogConsumer is the base class for the message logging system in TNL.

TNL by default doesn't log messages anywhere, but users of the library can instantiate subclasses that override the logString method. Any instantiated subclass of LogConsumer will receive all general logprintf's, as well as any TNLLogMessages that are enabled via the TNLLogEnable macro.


Public Member Functions

 LogConsumer ()
 Constructor adds this LogConsumer to the global linked list.

virtual ~LogConsumer ()
 Destructor removes this LogConsumer from the global linked list, and updates the log flags.

LogConsumergetNext ()
 Returns the next LogConsumer in the linked list.

virtual void logString (const char *string)
 Writes a string to this instance of LogConsumer.


Static Public Member Functions

LogConsumergetLinkedList ()
 Returns the head of the linked list of all log consumers.


Private Attributes

LogConsumermNextConsumer
 Next LogConsumer in the global linked list of log consumers.

LogConsumermPrevConsumer
 Previous LogConsumer in the global linked list of log consumers.


Static Private Attributes

LogConsumermLinkedList
 Head of the global linked list of log consumers.


Constructor & Destructor Documentation

TNL::LogConsumer::LogConsumer  ) 
 

Constructor adds this LogConsumer to the global linked list.

virtual TNL::LogConsumer::~LogConsumer  )  [virtual]
 

Destructor removes this LogConsumer from the global linked list, and updates the log flags.


Member Function Documentation

LogConsumer* TNL::LogConsumer::getLinkedList  )  [inline, static]
 

Returns the head of the linked list of all log consumers.

LogConsumer* TNL::LogConsumer::getNext  )  [inline]
 

Returns the next LogConsumer in the linked list.

virtual void TNL::LogConsumer::logString const char *  string  )  [virtual]
 

Writes a string to this instance of LogConsumer.

By default the string is sent to the Platform::outputDebugString function. Subclasses might log to a file, a remote service, or even a message box.


Field Documentation

LogConsumer* TNL::LogConsumer::mNextConsumer [private]
 

Next LogConsumer in the global linked list of log consumers.

LogConsumer* TNL::LogConsumer::mPrevConsumer [private]
 

Previous LogConsumer in the global linked list of log consumers.

LogConsumer* TNL::LogConsumer::mLinkedList [static, private]
 

Head of the global linked list of log consumers.