cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vadim Gritsenko <vadim.gritse...@verizon.net>
Subject Re: cvs commit: xml-cocoon2/src/java/org/apache/cocoon/environment AbstractEnvironment.java
Date Thu, 16 Jan 2003 18:40:59 GMT
Carsten Ziegeler wrote:

>Vadim Gritsenko wrote:
>
>  
>
>>> -            getLogger().debug("redirect: entering session mode");
>>> +            if (getLogger().isDebugEnabled()) {
>>> +                getLogger().debug("redirect: entering session mode");
>>> +            }
>>>
>>>      
>>>
>>Hi Carsten,
>>
>>I think you overdoing this a bit: if(){debug()} here is twice less 
>>efficient as single debug() call, because debug()'s argument is the 
>>constant from the class' constants pool, not a dynamic string.
>>    
>>
>
>I don't want to discuss if isDebugEnabled() is not as efficient as
>debug() - but I really guess it is.
>The reason for the change above is simple, it's a) consistent and
>b) if you change the log message and add some dynamic information the
>extra check is there and cannot be forgotten.
>  
>

Ok, fair enough.

Vadim


>This is really a problem, because we agreed a long time ago do to the
>extra checks. Take a look at the code, there are still places where
>the extra checks are not done as not all of us really care about this.
>
>  
>
>>IIRC, we already agreed some time ago that simple debug output should 
>>not be wrapped into if().
>>
>>    
>>
>Hmm, I cannot remember anything like this, sorry. (weak mind perhaps?)
>
>Carsten
>  
>



---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Mime
View raw message