check if debugging is enabled before calling the debug or debug_http functions