commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Geir Magnusson Jr." <>
Subject Re: [Logging] [VOTE] Commons Logging 1.0 Release
Date Wed, 30 Jan 2002 12:09:26 GMT
On 1/29/02 4:03 PM, "Craig R. McClanahan" <> wrote:

> On Tue, 29 Jan 2002, Waldhoff, Rodney wrote:
>> Date: Tue, 29 Jan 2002 14:56:39 -0600
>> From: "Waldhoff, Rodney" <>
>> Reply-To: Jakarta Commons Developers List <>
>> To: 'Jakarta Commons Developers List' <>
>> Subject: RE: [Logging] [VOTE] Commons Logging 1.0 Release
>>> you may want to consider making the parameters
>>> Strings not objects. They were made strings so that
>>> you could render objects with Log4j. No other logging
>>> toolkit does this. Thus if this is allowed/used you are
>>> directly binding to Log4j anyway - why not use Log4j
>>> directly in that case?
>> What's it hurt to leave Objects in there? String.valueOf(object) is easy
>> enough to do, and it supports the richer functionality provided by log4j.
>> Why go out of our way to restrict functionality that's otherwise trivial to
>> support?
> Changing Object to String would in fact represent a loss of functionality
> if the underlying logging implementation you are using knows how to deal
> with Objects in interesting ways (for example, it might use reflection to
> dump out all the bean properties).

Sure, but that isn't in the contract implicit in the interface, is it?
There is no reason to believe that anything passed in is a bean, for

Also, why should I trust the underlying impl to not do wacky things to the
objects I pass in?  Like invoke methods arbitrarily?

One solution might be to offer overloaded methods, and allow an impl to
throw some kind of NotImplementedException for the methods that take
Objects, so I have both safety as well as freedom.  (You generally have to
give up one for the other...)

Geir Magnusson Jr.                           
System and Software Consulting
"He who throws mud only loses ground." - Fat Albert

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message