I have normally used more than just four levels, though they don't necessarily have names. You might look at the levels provided by the 'syslog
' daemon process.
0 - Emergency (emerg)
1 - Alerts (alert)
2 - Critical (crit)
3 - Errors (err)
4 - Warnings (warn)
5 - Notification (notice)
6 - Information (info)
7 - Debug (debug)
(The log4j package adds a level below 'debug' called 'Trace', but provides just 'Fatal' where syslog
and syslogd
provide Emergency, Alerts and Critical.) These are not directly relevant, but should give you some pause for thought. The list provided by Pax is pretty reasonable.
One thing that I've often found useful is segmentation of the debugging - different levels of debugging settable for different components of the system. For example, depending on where the trouble is, I might need heavy debugging in the input section and macro management section, while not needing any debugging in the main processing code. A single debugging level across the whole program is considerably better than nothing, but for complex programs, differentiation is invaluable.
You can find the source I use on GitHub in my SOQ (Stack
Overflow Questions) repository as files debug.h
, debug.c
, mddebug.c
in the src/libsoq
sub-directory.