Our team has the policy of doing logging like
if (LOGGER.isDebugEnabled()) {
LOGGER.debug("model[" + model + "]");
}
instead of simply calling the logging method like this:
LOGGER.debug("model[" + model + "]");
This practice is capable of leading to some performance improvement, but on the other hand it makes the codebase more complex. Our application has no performance problems, probably never will, the argument for the introduction of the policy was simply that it's a good practice, so it shall be used every time we are doing logging.
Do you think it's a good policy?