Re: svn commit: r416346 [1/3] - in /lucene/nutch/trunk/src: java/org/apache/nutch/analysis/ java/org/apache/nutch/clustering/ java/org/apache/nutch/crawl/ java/org/apache/nutch/fetcher/ java/org/apach

2006-06-22 Thread Doug Cutting

[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


Re: svn commit: r416346 [1/3] - in /lucene/nutch/trunk/src: java/org/apache/nutch/analysis/ java/org/apache/nutch/clustering/ java/org/apache/nutch/crawl/ java/org/apache/nutch/fetcher/ java/org/apach

2006-06-22 Thread Jérôme Charron

I don't think guards should be added everywhere.


That's right Doug.
It was a rude first pass on logging.
The next pass (finest) will be done with NUTCH-310.



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.


Yes, but that's actually not the case in Nutch : The major part of logging
statements are using Info level.



  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.


I plan to review all the logging statements while working on NUTCH-310,
and I will then follow your directions.

Thanks

Jérôme

--
http://motrech.free.fr/
http://www.frutch.org/