----- Original Message ----- 
From: "Tom Klaasen (TeleRelay)" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, December 05, 2001 4:40 PM
Subject: RE: Cocoon 2.0 Scalability Disappointment




> -----Original Message-----
> From: [mailto:[EMAIL PROTECTED]] 
> > > 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.
>
>How would you do that? The reason for calling the "isDebugEnabled()" is
>exactly to avoid all the work involved in concatenating the Strings
>you're providing as parameter. And this would also be done with static
>methods...

Correct, it was quite stupid of me not to think of this widely used case...
the fact is that my debug statements are usually Strings that are already
there, so I don't have overhead on it.
Instead of concatenating you could call the static method for debug
many times, one on each part, or use the command pattern with
pooled command classes... but I'm getting ridiculous ;-) , it's
not something to suggest ;-)

Nicola Ken Barozzi These are the days of miracle and wonder... 
                               ...so don't cry baby, don't cry 
<[EMAIL PROTECTED]> Paul Simon 


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]

Reply via email to