The default debug!() macro can already be turned on and off using a log-level. By wrapping the macro in a function the source of the debug is not shown correctly.
Solutions:
Just use the default log level system
Wrap the call to debug! in a macro instead of a function so positional information is not lost
The default debug!() macro can already be turned on and off using a log-level. By wrapping the macro in a function the source of the debug is not shown correctly.
Solutions: