> -----Original Message-----
> From: Simon Kitching [mailto:[EMAIL PROTECTED] 
> Sent: Thursday, December 09, 2004 6:39 PM
> To: Jakarta Commons Developers List
> Subject: RE: [logging] Enterprise Common Logging... dare we say 2.0?
> 
> On Fri, 2004-12-10 at 14:23, Simon Kitching wrote:
> 
> > Alas, I don't think that is efficient enough. This approach would
> > require a new Message object to be created *before* each call,
> > regardless of whether that logging level was enabled or not.
> > 
> > Of course, each call could be wrapped in:
> >   if (log.isWarnEnabled()) {
> >     log.warn(new Message(....));
> >   }
> > but that would get tiring very quickly!
> 
> Not to mention that it is pretty much equivalent to:
>   if (log.isWarnEnabled()) {  
>     // compute internationalised message by hand
>     // using a resource bundle, key + params
>     log.warn(msgString);
>   }

Not really.  The code that should go where your comment exists is not as
trivial as a couple lines of code.  Also, as I mentioned in my other
reply, using such code guards should really be common practice, usually
to avoid unnecessary string concatenation when constructing the message
to be logged.

Further, as mentioned earlier in this thread, by putting the i18n/l10n
functionality within the JCL, you avoid reinventing the wheel across
projects.

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


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

Reply via email to