Only write debug output when in debug mode