[EMAIL PROTECTED] wrote:
NUTCH-309 : Added logging code guards
[ ... ]
+          if (LOG.isWarnEnabled()) {
+            LOG.warn("Line does not contain a field name: " + line);
+          }
[ ...]

-1

I don't think guards should be added everywhere. They make the code bigger and provide little benefit. Rather, guards should only be added in performance critical code, and then only for "Debug"-level output. "Info" and "Warn" levels are normally enabled, and developers should thus not log messages at these levels so frequently that performance will be compromised. And not all "Debug"-level log statements need guards, only those that are in inner loops, where the construction of the log message may significantly affect performance.

Doug

Reply via email to