libcwd: The C++ Debugging Support Library - Reference Manual
Author: Carlo Wood
Description: C++ debugging support library with ostream debug output
Keywords: libcwd, debug output, debug facility, debug channel, object orientation, OO, C++, nested debug output, ostream, memory allocation, debugging, source file and line number

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

# Custom Debug Objects
[Setting The Output Destination]

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)
  libcwd::libcw_do