Change logger.debug function when is not in debug mode to increase performance.