hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sam Berlin <sber...@limepeer.com>
Subject Re: Consider UGLI
Date Tue, 04 Jan 2005 17:42:34 GMT
UGLI does look to be nice, but I'm confused about how the parameterized 
log messages can be done without using Java 1.5's varargs construct.  
Does ULogger expose a lot of overloaded functions that can take an 
extreme amount of arguments?

The antfile also highlighted some other questions -- namely, trace 
level debugging is removed, the isXEnabled methods are removed (in 
favor of isEnabled(Level.X)), and it looks like the replacements are 
directly using log4j instead of ULogger interfaces.  Are these changes 
necessary in order to move to UGLI?

(My questions are more out of curiosity in moving to UGLI for our own 
project, but I imagine will also have relevance with httpclient.)

Thanks,
  Sam

On Jan 4, 2005, at 11:49 AM, Eric Bloch wrote:

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


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