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...
#include <libcwd/debug.h>
Public Member Functions | |
channel_ct (char const *label, bool add_to_channel_list=true) | |
Construct a new debug channel with name label. More... | |
void | off () |
Turn this channel off. More... | |
void | on () |
Cancel one call to ‘off()’. More... | |
char const * | get_label () const |
Pointer to the label of the debug channel. | |
bool | is_on () const |
Returns ‘true’ if the channel is active. | |
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.
Whenever debug output is written, one or more debug channels must be specified (as first parameter of the Dout macro). 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.
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
and
gives as result
|
inlineexplicit |
Construct a new debug channel with name label.
A newly created channel is off by default (except dc::warning). All channel objects must be global objects.
void libcwd::channel_ct::off | ( | ) |
Turn this channel off.