This stuff is implemented in the lib/log.c module
and by default prototyped in lib/lib.h.
There are two levels of debugging. Global debugging is turned on
if there is the macro DEBUG
defined. The local debugging
should be turned on and off for every module separately by defining the macro LOCAL_DEBUG
.
These functions should be used for debugging and informative printing
purposes, the format is the same as in the printf
function.
msg
: Print message to stdout.
err
: Print message to stderr.
die
: Print message to stderr and abort the process.
DBG
: Macro doing the same job as msg
, but only if LOCAL_DEBUG
is defined.
DBGLN
: Dtto, but with source line number prepended.
BUG
: Abort process.
The wide usage of ASSERT
macro is recommended.