On Thu, 2008-02-21 at 17:01 +0000, Ravi Kutaphale wrote:
> About the conditional logs, I somehow dont agree with you that it will
> decrease code readability.  When traversing a code most of us do
> ignore the log statement. so 
> if(log.isDebugEnabled) { 
>         log.debug("some exception trace"); 
> } 
> 
> will be similar for developer as : 
> 
> log.debug("some exception trace"); 
> 
> But will definately improve runtime performance by avoiding string
> creation.

Interesting!

I'm also leaning away from the 3-line form of the debug statement (as a
matter of personal preference in terms of readability and writability),
but it would be interesting to see--after version 1.1 is released--just
how big a win this might be in terms of performance.

I've worked on other systems where we enclosed logging statements in
similar conditional blocks, but I never really questioned why.

-- 
Adam Monsen


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/

Reply via email to