Re: Cost of debug statements.

2007-03-30 Thread Enis Soztutar
Doug Cutting wrote: Nigel Daley wrote: Just a caveat: when there is conditional code like this based on the configured logging level, then testing should be done with different logging levels to verify that there are no side effects or exceptions (such as NPE) generated by these conditional code

Re: Cost of debug statements.

2007-03-29 Thread Doug Cutting
Nigel Daley wrote: Just a caveat: when there is conditional code like this based on the configured logging level, then testing should be done with different logging levels to verify that there are no side effects or exceptions (such as NPE) generated by these conditional code blocks. FWIW, this

Re: Cost of debug statements.

2007-03-29 Thread Raghu Angadi
Thanks. There is a isDebugEnabled() also. We should convert many of our debug statements into this. I will do as I submit patches. Raghu. Dhruba Borthakur wrote: There are portions code in the Namenode: if (NameNode.stateChangeLog.isInfoEnabled()) { ... } -Original Message- From:

Re: Cost of debug statements.

2007-03-29 Thread Doug Cutting
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 guidelines: Guards should only be used: 1. in inner-loop code where pe

Re: Cost of debug statements.

2007-03-29 Thread Nigel Daley
Just a caveat: when there is conditional code like this based on the configured logging level, then testing should be done with different logging levels to verify that there are no side effects or exceptions (such as NPE) generated by these conditional code blocks. FWIW, this is not something I c

RE: Cost of debug statements.

2007-03-29 Thread Dhruba Borthakur
There are portions code in the Namenode: if (NameNode.stateChangeLog.isInfoEnabled()) { ... } -Original Message- From: Raghu Angadi [mailto:[EMAIL PROTECTED] Sent: Thursday, March 29, 2007 11:00 AM To: hadoop-dev@lucene.apache.org Subject: Cost of debug statements. Is there a way to