Go to the first, previous, next, last section, table of contents.


DL.h: support for printf style logging

These routines are used to provide logging functions. Messages can be divided into classes and separately enabled and disabled.

Macro: void DL (args...)
Used to log a message.

Defaults to a using fprintf on stderr.

Macro: void DLG (bool guard, args...)
Macro: void DLH (function handler, args...)
Macro: void DLP (text param, args...)
Macro: void DLGP (bool guard, text param, args...)
Macro: void DLHP (function handler, args...)
Macro: void DLGHP (bool guard, function handler, args...)
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.

Macro: void VDL ((args...))
Macro: void VDLG ((bool guard, args...))
Macro: void VDLH ((function handler, args...))
Macro: void VDLP ((text param, args...))
Macro: void VDLGP ((bool guard, text param, args...))
Macro: void VDLHP ((function handler, args...))
Macro: void VDLGHP ((bool guard, function handler, args...))
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));

Macro: int DL_LEVEL
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.

Macro: text DL_DEFAULT_HANDLER
The default handler for printing which is simply the name of the printing function.

Defaults to fprintf

Macro: bool DL_DEFAULT_GUARD

Defaults to TRUE.

Macro: text DL_DEFAULT_PARAMS
Defaults to stderr

Macro: flag DL_SHOW_TIME
Each message can be given an individual time stamp by defining DL_SHOW_TIME. This causes the _L_gettime routine to be called before each message which generates the timestamp. A default version is provided by the nana library.


Go to the first, previous, next, last section, table of contents.