commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joerg Hohwiller <>
Subject Re: [logging] Logger.getName
Date Wed, 28 Sep 2005 18:36:07 GMT
Hash: SHA1

Jörg Schaible wrote:
> Joerg Hohwiller wrote on Wednesday, September 28, 2005 12:40 AM:
>>Hash: SHA1
>>Hi everybody,
>>since nothing happened after I opened bugzilla issue 15939
>>and called for discussion, I simply started changing all
>>implementations of Log so they implement Logger instead (all
>>locally). I will supply the patch, when I am done.
>>Now what I found out when worked on LogKitLogger, is that
>>they deperected the "getCategory()" method which is the
>>analogy of the invented "getName()" method. Their deprecation
>>is: <quote> Deprecated. This method violates Inversion of
>>Control principle. If you are relying on its presence then
>>there may be something wrong with the design of your system </quote>
>>Actually it seems they have now even completely removed the method:
>>I can not see the point (esp. when there are methods as
>>"public synchronized Logger[] getChildren()")?
>>Can someone give me a hint?
>>I do not really need the "getName()" method and could also leave it out
>>of Logger. But for me it would still make sense to have the method and
>>it would be possible to implement it.
> Well, since getCategory is already gone, you cannot implement getName anymore in a compatible
Yes and no. For some logger implementations I can not get the name back
from the actual logger insance. But after all "we" are the ones who
construct the loggers and have the adapters. So we can store the name
together with the actual adapted logger instance.
This has already been done for many of the adapter implemenetations.

> What will work as alternative is:
> 	Logger getChild(String name)
> This is basically, what Niclas proposed as use case for getName():
> 	Logger loggfer = Logger.getLogger(parentLogger.getName + ".child");
> getChild can be implemented for all logger packages that either support getName or have
getChild ... and this seems all of them. WDYT?
Yes. "getChildLogger" can be implemented in an appropriate way (while
NoLogger returns itself) for all of them without trouble.

So the question still is if I should implement getName() or kick it out.
> - Jörg
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Thunderbird -


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

View raw message