4 ms·
You want to wrap it in an if in order to avoid doing extra work ( like string concatenation or whatever ) and save some computation. It's to improve performance
by zer0gravity 10y ago
You want to wrap it in an if in order to avoid doing extra work ( like string concatenation or whatever ) and save some computation. It's to improve performance when logging is not enabled.
- CHY872 10y agoGenerally you would log with placeholders, like logger.debug("My logger message has placeholders {}, {}, {}", some, objects, toLog); which avoids the issue.