Detailed Description
All debug output is written in the following format:<margin> <label> <marker> <indentation> <data> <suffix>The <margin> field can for instance be used to print the ID of the process or thread (useful when writing debug messages from more than one process or thread to the same ostream device). The <marker> field can be used to identify regions (for example with a vertical line) depending on the current context. The <indentation> field consists of spaces and is intended to make debug output better readable by grouping lines of debug output as an easier alternative than using the marker field for that purpose.The <label> field exists of the channel label (as passed to the constructor of a
channel_ct ) padded by spaces to make this field constant in width (it is padded to the length of the longest existing channel label), followed by the marker, which is by default a colon plus a final space; for example "NOTICE : ".The <data> field represents the second field of the
Dout macro, written to the debug ostream with the operator<< inserters.Finally, the <suffix> field is by default a new-line, optionally followed by a flush. The debug control flag error_cf however, causes an error message to be inserted first. The suffix field could become for example ": EAGAIN (Try again)\\n".
- See also
- Control Flags
Example:
void assign(char const *str, size_t len)
Assign str with size len to the string.
Definition: class_debug_string.inl:50
#define Dout(cntrl, data)
Macro for writing debug output.
Definition: debug.h:154
#define Debug(STATEMENTS...)
Encapsulation macro for general debugging code.
Definition: debug.h:124
channel_ct notice
Definition: debug.cc:460
debug_ct libcw_do
The default debug object.
Definition: debug.cc:429
Outputs
NOTICE : | This line is not indented
NOTICE : | This line is indented 4 spaces
NOTICE : | This line is indented 6 spaces