hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eric Bloch <bl...@laszlosystems.com>
Subject Re: Consider UGLI
Date Tue, 04 Jan 2005 16:49:12 GMT


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"]." );
>   }

Just to be clear, you still suffer the cost of the string allocation and 
assembly, right?  I've heard this is better in Java 1.5, but I'm not up 
on that.

I'd love to hear pros/cons on how this compares to commons-logging with 
respect to class-loader problems.

-Eric


---------------------------------------------------------------------
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