performance: conditional debugging

now we use this macro for all frequent debug messages so that we don't
actually call them in case we aren't in debug mode. This will prevent call
of CPU expensive string functions.