commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Leo Simons <leosim...@apache.org>
Subject Re: [logging] To depend or not to depend?
Date Wed, 12 Feb 2003 18:47:28 GMT
Hi peeps,

Leo Simons wrote:
>> Would it be acceptable
>>> to add a getName() or something similar to the Log interface and the
>>> implementations?
<snip/>
> It is a backwards-incompatible change

tried a few things here, and I think the answer to my own question is a 
definitive "no": it breaks backwards (binary) compatibility across 
jakarta commons, and who knows where else. It is potentially disastrous 
for projects that provide their own implementation of the Log interface. 
Consider, for example, a log implementation where no name is ever 
associated with a category. It's a change-of-contract, indeed.

I think all alternatives mentioned within the boundary of 
commons-logging are also not very good moves, like adding a NamedLog, 
which will add to jar size, probably will not be used in many apps, and 
moreover breaks the entire *single interface* paradigm -- the main 
reason (yep, assumption here ;) that commons-logging exists.

Also, one can safely assume that in true IoC (ie avalon), the thing (ie 
the container) that sets up the logging also has the information as to 
how the logging is to be named, and hence can pass this in to an avalon 
CommonsLogger on creation.

Got up to speed on some new tech this weekend, and lo and behold, plexus 
already has a CommonsLogger which does exactly that:

http://tambora.zenplex.org/cgi-bin/viewcvs.cgi/plexus/src/java/org/apache/plexus/logging/commons/CommonsLogger.java

ain't that cool :D

We had some discussion over @ avalon on including a CommonsLogger class 
in 4.1.4, but it didn't make it (we need to remove some logging-related 
confusion ;). Subject will be raised again for 4.1.5, or maybe 
CommonsLogger goes into a utility library.

Last thing I took away from this thread is that I do think a 
commons-noop-logging.jar is a common need for those times when you don't 
want logging, or at least don't want a dependency. I'll send in a patch 
if it ever does become enough of an itch :D


anyway, thanks for all your feedback!


cheers,

- Leo



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


Mime
View raw message