cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ceki Gülcü <>
Subject Re: [Proposal] Use UGLI as logging abstraction (Re: [RT] Logging
Date Fri, 21 Jan 2005 17:06:45 GMT


We have noticed that over 95% of log statements have zero, one or two
parameters. The additional two methods (per logging level) that have
been introduced in 1.3 and UGLI offer a convenient alternative to the
if(logger.isXXXEnabled() {"some txt"+arg1+"following txt") }

Thus, instead of writing

if(logger.isDebugEnabled() {
   logger.debug("New temperature is "+newT+" degrees");

you can write

   logger.debug("New temperature is {} degrees", newT);

I personally typed in several hundred such parameterized log
statements with relative ease. Existing statements can also be
converted with ease.

For the remaining 5% of the cases with 3 or more parameters, the
if(l.isDebugEnabled) is still availalbe.

It's a pity that you should consider parameterized messages as a
hack. Please do not hesitate to continue this discussion on

Best regards,

On 2005-01-07 10:30:11, Torsten Curdt wrote:

 > As I already said: I don't see the point of this parameter stuff.  IMO
 > this only leads to mixing of concepts. Some people will use the "{}"
 > some won't. To be honest I would not feel very happy with UGLI since
 > IMHO this interface is only half-backed. Sorry.

Ceki Gülcü

   The complete log4j manual:

View raw message