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
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
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:
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
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
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