ACE  6.1.0
Public Member Functions
ACE_Log_Msg_Callback Class Reference

An interface class used to get logging callbacks. More...

#include <Log_Msg_Callback.h>

List of all members.

Public Member Functions

virtual ~ACE_Log_Msg_Callback (void)
 No-op virtual destructor.
virtual void log (ACE_Log_Record &log_record)=0

Detailed Description

An interface class used to get logging callbacks.

Users who are interested in getting the logging messages directly, can subclass this interface and override the log() method. They must then register their subclass with the Log_Msg class and make sure that they turn on the ACE_Log_Msg::MSG_CALLBACK flag.

Your log() routine is called with an instance of ACE_Log_Record. From this class, you can get the log message, the verbose log message, message type, message priority, and so on.

Remember that there is one Log_Msg object per thread. Therefore, you may need to register your callback object with many ACE_Log_Msg objects (and have the correct synchronization in the log() method) or have a separate callback object per Log_Msg object. Moreover, ACE_Log_Msg_Callbacks are not inherited when a new thread is spawned because it might have been allocated off of the stack of the original thread, in which case all hell would break loose... Therefore, you'll need to reset these in each new thread.


Constructor & Destructor Documentation

ACE_Log_Msg_Callback::~ACE_Log_Msg_Callback ( void  ) [virtual]

No-op virtual destructor.


Member Function Documentation

virtual void ACE_Log_Msg_Callback::log ( ACE_Log_Record log_record) [pure virtual]

Callback routine. This is called when we want to log a message. Since this routine is pure virtual, it must be overwritten by the subclass.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines