cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Royal <>
Subject Re: Cocoon 2.0 Scalability Disappointment
Date Fri, 30 Nov 2001 19:01:15 GMT
On Friday 30 November 2001 01:49 pm, you wrote:
> > I think this can be an appropriate timing to start cleaning up the
> > logging code. We have to find a policy and stick to it: I tend to say
> > that we should *always* do a isDebugEnabled() or a isInfoEnabled()
> > before spitting out Strings. I'm not that sure that such a policy should
> > be enforced for levels of warn and above.
> I totally agree.
> This sped up my app quite a bit.
> Maybe a static utility method that does the check is nicers than many ifs.

Assuming you are talking about something like:

public static logDebug(final Logger logger, final String string) {
 if (logger.isDebugEnabled()) {

that won't work because the point is to never reach the code that constructs 
the string. AFAIK it has to be done as
 if (getLogger().isDebugEnabled()) getLogger().debug("your message");

I followed Stefano's rant on this a month ago or so and have been changing 
all my code to the above syntax.

<ide plug>
Using a nifty IDE such as IDEA from IntelliJ, you can define templates in 
code, so i just type debug<tab> and it spits out 
if (getLogger().isDebugEnabled()) getLogger().debug();
with the cursor inbetween the debug() braces ready for the string. Makes it 
</ide plug>


peter royal ->

To unsubscribe, e-mail:
For additional commands, email:

View raw message