Main Page   Reference Manual   Namespace List   Compound List   Namespace Members   Compound Members   File Members  

Custom Debug Objects
Collaboration diagram for Custom Debug Objects:
Each debug object is associated with one ostream.  The default debug output macros Dout and DoutFatal use the default debug object libcwd::libcw_do.  Other debug objects may be created as global objects; it is convenient to define new macros for each (custom) debug object using the generic macros LibcwDout and LibcwDoutFatal.For example, add something like the following to your own "debug.h" file:
#ifdef CWDEBUG
extern libcwd::debug_ct my_debug_object;
#define MyDout(cntrl, data) LibcwDout(DEBUGCHANNELS, my_debug_object, cntrl, data)
#define MyDoutFatal(cntrl, data) LibcwDoutFatal(DEBUGCHANNELS, my_debug_object, cntrl, data)
#else // !CWDEBUG
#define MyDout(a, b)
#define MyDoutFatal(a, b) LibcwDoutFatal(::std,, a, b)
#endif // !CWDEBUG
See Also
The Output Device (Debug Object)
Copyright © 2001 - 2004 Carlo Wood.  All rights reserved.