Miscellaneous helper functions and macros for debug output. More...
Classes | |
| class | libcwd::buf2str |
| Print a (char) buffer with a given size to a debug ostream, escaping non-printable characters. More... | |
| class | libcwd::char2str |
| Print a char to a debug ostream, escaping non-printable characters as needed. More... | |
Macros | |
| #define | ForAllDebugChannels(...) |
| Looping over all debug channels. | |
| #define | ForAllDebugObjects(...) |
| Looping over all debug objects. | |
Functions | |
| Channel * | libcwd::find_channel (char const *label) |
Find debug channel with label label. | |
| void | libcwd::list_channels_on (DebugObject &debug_object) |
| List all debug channels to a given debug object. | |
The generated API reference documents miscellaneous functions and utility macros used with libcwd debug output.
| #define ForAllDebugChannels | ( | ... | ) |
The macro ForAllDebugChannels allows you to run over all debug channels.
For example,
which turns all channels on. And
which turns all channels off.
| #define ForAllDebugObjects | ( | ... | ) |
The macro ForAllDebugObjects allows you to run over all debug objects.
For example,
would set the output stream of all debug objects to std::cerr.
| Channel * libcwd::find_channel | ( | char const * | label | ) |
label. If there is more than one such debug channel, the object with the lexicographically largest name is returned. When no debug channel could be found, NULL is returned. | void libcwd::list_channels_on | ( | DebugObject & | debug_object | ) |
Example:
Example of output:
DEBUG : Disabled NOTICE : Enabled WARNING : Enabled SYSTEM : Enabled LLISTS : Disabled KERNEL : Disabled IO : Disabled FOO : Enabled BAR : Enabled
Where FOO and BAR are user defined channels in this example.
References libcwd::Channel::get_label(), libcwd::Channel::is_on(), and noprefix_cf.