hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ortwin Glück <ortwin.glu...@nose.ch>
Subject Re: Consider UGLI
Date Tue, 04 Jan 2005 16:16:50 GMT
The words of the expert. This is fantastic news!

Thanks for your effort

Ortwin Glück

Ceki Gülcü wrote:
> 
> Ortwin,
> 
> Since the org.apache.log4j.Logger class is a direct implementation of
> org.apache.ugli.ULogger interface, there is no need to wrap a log4j
> Logger to conform to the UGLI interface. Log4j Loggers are already
> ULoggers. It follows that the objects returned by
> o.a.ugli.LoggerFactory.getLogger("x") are identical to those returned
> by o.a.log4j.Logger.getLogger("x").
> 
> Thus, using UGLI in conjunction with log4j will not carry any overhead
> whatsoever.
> 
> 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);
> 
> Give or take a nano-second, when the log statement is disabled, both
> forms perform equally well but the second form is easier to read and
> to write.
> 
> I hope this answers your question.

-- 
  _________________________________________________________________
  NOSE applied intelligence ag

  ortwin glück                      [www]      http://www.nose.ch
  software engineer
  hardturmstrasse 171               [pgp id]           0x81CF3416
  8005 zürich                       [office]      +41-1-277 57 35
  switzerland                       [fax]         +41-1-277 57 12

---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpclient-dev-help@jakarta.apache.org


Mime
View raw message