check if debug is enabled before printing tracebacks