State of the debugging flags.

Hal Murray hmurray at megapathdsl.net
Tue May 30 23:50:59 UTC 2017


> Every instance I've seen has the logging code enclosed in an #ifdef  block
> for the debug compilation switch, whether directly where it is  used, of
> inside of a macro. It would appear that someone began to replace the
> explicit if debugs with macros, but never completed it for unknown reasons.

I don't know about the TRACE stuff.

Most of the simple debugging printout is with the DPRINTF macro.

That doesn't work if you need to compute something to get printed.  In that 
case, the code should be something like:
#ifdef DEBUG
  if (debug > x) {
    compute, compute, compute
    print, print, print
  }
#endif

If you find anything like that without any computation, it can/should be 
changed to use DPRINTF.



-- 
These are my opinions.  I hate spam.





More information about the devel mailing list