On Wed, 05 Jan 2005 15:42:08 -0500, Stefano Mazzocchi
<[EMAIL PROTECTED]> wrote:
> Nicola Ken Barozzi wrote:
> > Antonio Gallardo wrote:

> > I saw that too, but UGLI should not need that extra isLogEnabled stuff
> > in any case.

How so? What am I missing?

> > As noted in my previous message, UGLI also supports parameterized log
> > messages obliterating the need to surround log messages with
> > logger.isXXXEnabled checks.
> >
> > Instead of writing:
> >
> >    if(logger.isDebugEnabled()) {
> >      logger.debug("User with "+id+" entered wrong query string
> > ["+query"]." );
> >    }
> >
> > you can just write:
> >
> >    logger.debug("User with {} entered wrong query string [{}].", id,
> > query);
> > "
> 
> very pythonish. I like it :-)
> 
> -1 on just4log then.

I'm probably not getting the point. This solves the string
concatenation issue (which, besides and AFAIU, today is quite a bit
faster than it used to be in older JVMs), but isn't necessarily, and
per se, a permanent solution.  Since this is an interface (and quite
an ugly one given the two parameter limitation... what's wrong with a
logger.xxx(String message, String[] params) as an alternative?), you
don't know if the current implementation just tokenizes the message
and performs concatenation anyway. Moreover, this is no solution to
logger.debug("my {} message", runMeAndIllKillYourMachine()) which
still would need to be wrapped...
 
Ciao,
-- 
Gianugo Rabellino
Pro-netics s.r.l. -  http://www.pro-netics.com
Orixo, the XML business alliance: http://www.orixo.com

Reply via email to