commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Emmanuel Bourg <>
Subject Re: [logging] Enterprise Common Logging... dare we say 2.0?
Date Fri, 17 Dec 2004 11:51:27 GMT
I don't think this alternative has been proposed, the additional 
features could also be provided by a decorator, something like :

ExtendedLog log = new ExtendedLog(LogFactory.getLog(Foo.class));


ExtendedLog log = LogFactory.getExtendedLog(Foo.class));

For localization, ExtendedLog would create a LogMessage and pass it to 
the log implementation. It could also add a code guard to reduce object 

     public void debug(String key, Object[] params) {
         if (log.isDebugEnabled()) {
             log.debug(new LogMessage(key, params));

For log implementations supporting i18n, the key is extracted from the 
LogMessage and searched in a resource bundle. For other implementations, 
LogMessage.toString() returns the key and the parameters concatenated.

Just some thoughts :) For i18n I think I like Curt's solution of parsing 
the message in the implementation.

Emmanuel Bourg

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

View raw message