Controlling which debug output is emitted by toggling channels on and off. More...
Topics | |
| Predefined Debug Channels | |
| Generated API reference for the debug channels supplied by libcwd. | |
Classes | |
| class | libcwd::Channel |
| This object represents a debug channel, it has a fixed label. A debug channel can be viewed upon as a single bit: on or off. More... | |
Whenever debug output is written, one or more debug channels must be specified. The debug output is then written to the ostream of the debug object unless the debug object is turned off or when all specified debug channels are off. Each debug channel can be turned on and off independently.
Libcwd has defined six debug channels in namespace libcwd::channels::dc (See Predefined Debug Channels). New debug channels can be defined by the user in namespace LIBCWD_DEBUG_CHANNELS::dc, which is as simple as creating a new Channel object.
Example,
Multiple debug channels can be given by using operator| between the channel names. This shouldn't be read as `or' but merely be seen as the bit-wise OR operation on the bit-masks that these channels actually represent.
Example:
gives as result
NOTICE: Libcwd is a great library
and
gives as result
HELLO : Hello World! KERNEL: This is written when either the kernel or io channel is turned on.