hadoop-common-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Doug Cutting <cutt...@apache.org>
Subject Re: Cost of debug statements.
Date Thu, 29 Mar 2007 18:15:02 GMT
Raghu Angadi wrote:
> if ( debugEnabled ) {
>   NameNode.stateChangeLog.debug( ...
> }

Yes, this is sometimes warranted.  I've also seen it abused, with, e.g., 
guards placed around all log statements.  I suggest the following 

Guards should only be used:
  1. in inner-loop code where performance is known to be critical; and
  2. for messages logged at a finer level than default (INFO), i.e., 
only for debug-level messages.

The case you mention seems to meet both of these criteria.  +1


View raw message