[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Debuglevels
Hi,
I looked through PenguinPlay.h & Co and didn't see any Debuglevel
definition. However I think they are really useful. What about something
like this:
PPDEBUGLEVEL == 0 : No debugging info
PPDEBUGLEVEL >= 1 : Info about entering/leaving major code sections (e.g.
"configfile parsing started" / "configfile parsing finished successfully")
PPDEBUGLEVEL >= 2 : More detailed progress info (e.g. "Processing
configfile line x")
PPDEBUGLEVEL >= 3 : medium detail info about the processed data (e.g. "Line
contains token 'DefaultResolution' with value '800x600'")
PPDEBUGLEVEL >= 4 : Info about variable values at important points (e.g.
"(int) DefaultResX = 800 ; (int) DefaultResY = 600")
PPDEBUGLEVEL >= 5 : Really excessively detailed information (e.g.
"LoopVariable = 1376 ; NoOfCopiedBytes = 327860 ; LastByteVal = 0x3F")
Of course That doesn't mean that every piece of code has to give this much
debug info ;) But if debug info is given it has to behave this way.
Some more notes:
* The messages should be indended according to their debuglevel (e.g. by
2*Level spaces) to make things more readable.
* Perhaps we should have Macros ppDebug1 () ... ppDebug5 () that take care
of Debuglevel checking. Would make the actual source more readable. Or
something like printk ()...
Cu
Christian
--
It's lonely in the saddle since the horse died...