I guess, if you have 10 gazillions of these statements in your code... The
very first line inside the method is isDebugEnabled() however the price paid
is creation of the String parameter. Makes sense now, thanks

Bob S.

-----Original Message-----
From: Marcin Maciukiewicz [mailto:[EMAIL PROTECTED] 
Sent: Friday, August 22, 2003 2:50 PM
To: STONE,ROBERT (HP-SanDiego,ex1)
Subject: Re: Logging format


Witaj ex1),

W Twoim liście datowanym 22 sierpnia 2003 (19:03:18) można przeczytać:


SRHSe> Hi guys,

SRHSe> Just curious why you're using in your code constructs like

SRHSe> if ( log.debuggingIsEnabled() ) {
SRHSe>         log.debug( "foo" );
SRHSe> }

SRHSe> Isn't this redundant? After all log.debug() will only output 
SRHSe> messages when debugging level is set to DEBUG. Why not just use 
SRHSe> log.debug( "foo" )? Saves you two lines...

JVM ommit those lines when
log.isDebugEnabled==false without carrying about log.debug(...). If U have
many log.debug calls it gives your code little speed-up.

Check http://jakarta.apache.org/log4j/docs/manual.html
"Performance" chapter


-- 
Greetz ciukes

Reply via email to