Optional Callback Object

Top  Previous  Next

Sometimes you may want to capture your own debug logging events.

 

The easiest way to do this is using the JrDebugCallback class.  Make your own class, derived from:

class JrDebugCallback {

public:

 virtual bool EventNotify(const char *fulltext) {return true;};

};

 

Your derived class may invoke a global function or a class member function inside its EventNotify code.  Create an instance of your derived class, and register it with the global JrDebug class:

JrDebug::SetCallbackPointer(class JrDebugCallback *inp);

 

Your EventNotify will be called before the event is written out; return false to prevent it from being written to any output; return true to process as normal.