Debug Macros - Good or Bad?

We could put the test in a function, but then some optimisations need to be enabled if we want to have zero overhead when debugging is disabled (-O1 is enough in this case).

On the other hand, leaving the test inline allows for more complicated debugging procedures that would otherwise have to be guarded by #ifdef / #endif directives.

I am not concerned about aesthetics in this case, I like debugging code to be easy to find and remove once the problem has been solved.

doesn't that depend on what you need debugging for? during development, during testing, out in the field, real-time where you can't log/print fast enough

you should consider as many different types of debugging as possible

I have had time where I had a log statement and a printf statement one after the other and the printf statement seemed to be skipped. I had expected them be one after the other in the monitor.