These routines are used to provide logging functions. Messages can be divided into classes and separately enabled and disabled. Note that these macros have no effect unless you run your program under the debugger and read in the commands generated by the ‘nana’ command. You also need to compile the program with the ‘-g’ option.
And all of the special functions.
The macros such as ‘DL’ depend on the GNU CC variable number of arguments to macros extension. If you wish to compile your code on other systems you might wish to use the following variations on ‘DL’, etc.
Each of these macros calls the corresponding function from the previous group, i.e. by default ‘VDL’ is equivelant to a call to ‘DL’. If ‘WITHOUT_NANA’ is defined then the call too ‘VDL’ is equivelant to ‘/* empty */’.
Thus you can have debugging under GCC whilst the code is still portable to other compilers. However debugging information will not be available on other platforms.
Note: the argument list is surrounded by two sets of brackets. For example:
VDL(("haze in darwin = %d\n", 3.4));
Used to enable and disable logging independently of guard expressions.
2
- Always print message
1
- Print message only if the guard expression is true.
0
- Never print any messages.
Defaults to
1
.