[slf4j-dev] SLF4J Implementation for Simple Log

Graham Lea grlea at dev.java.net
Wed Aug 10 14:51:35 CEST 2005


Ceki Gülcü wrote:

> I'll update the SLF4J web-site so that simple-log is listed as an
> implementation supporting the SLF4J API.

Excellent. Thanks.

> If you look at the the *not-yet-released* 1.0beta5 API [1], you will
> notice several changes, all assumed to be for the better. There are
> two main changes. First, support for org.slf4j.Marker interface was
> added as a first-class item in org.slf4j.Loggger interface.

Just from looking at the API for Marker & the associated Logger methods, 
I can't quite figure what the intended use is. :-[
Could you give me an example of when it would need to be used and how?

> Second,
> LoggerFactoryAdapter was renamed as ILoggerFactory. In my humble
> opinion, the old name was too much of a mouthful. In addition, the
> interface now contains a single method instead of the previous two.

Name changes don't really bother me, but I don't really like 
single-letter prefixes in class/interface names. (That's a personal 
preference.)
I think it's misleading in this case because LoggerFactory doesn't 
implement ILoggerFactory, which might throw a lot of people.
(I think EJB people are used to having the interface prefixed with 'I' 
and the implementation being the same name without the 'I'?)

It's all very hard, though, because the terms being used here - 
'Factory' and 'Adapter' - are very loaded, and people have certain 
expectations of classes that have these names.
I faced the same problem when I wrote Log Bridge 
<http://home.exetel.com.au/grlea/projects/log-bridge/api/org/grlea/logBridge/package-summary.html> 
and ended up calling the LoggerFactory equivalent there 'LogBridgeManager'.

I think the interface now called ILoggerFactory really is an adapter for 
the logger factory, so LoggerFactoryAdapter would probably be my preference.
I tend to prefer clarity over brevity, where practical.
Seeing as it should only be SLF4J implementers who are implementing the 
interface, I wouldn't consider brevity to be warranted in this situation.
In the end, though, I'm not really that concerned what it's called, as 
long as the javadoc makes it really clear what it is.
Another option you could consider would be making ILoggerFactory an 
inner-interface of LoggerFactory called simply 'Adapter'.

Anyway, enough blabbering.
I'm really keen to hear back about the Marker. :-)

Cheers,

Graham.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://qos.ch/pipermail/slf4j-dev/attachments/20050810/a907a16e/attachment.html>


More information about the slf4j-dev mailing list