Only output debug logging if debug is set to avoid long logs