[ 
http://issues.apache.org/jira/browse/LOGGING-110?page=comments#action_12451136 
] 
            
Simon Kitching commented on LOGGING-110:
----------------------------------------

You're right; sorry I got a little mixed up; trying to juggle too many things 
:0). What avalon doesn't support is getLogLevel(), which you are NOT proposing.

As you say, all the functionality *can* be implemented for all underlying libs. 
The implementation for things that don't expose isEnabled(level) and 
log(level,msg) methods (eg Avalon) isn't terribly elegant but works, and is 
only a minor performance hit. For the primary targets, an extra array lookup or 
similar is all that's needed.

The fact that introducing a new method is an incompatibility with existing 
external logging adapters is the biggest concern. The commons project takes 
compatibility very seriously; yes it's a pain but the commons libs are very 
widely used.

Note that it should be possible to write adapters from Jdk14 logging to other 
libs (eg log4j), meaning that your app can use jdk14 logging as its api while 
still allowing users of the code to map that to whatever logging lib they 
prefer. It's not as easy to write such an adapter as it is for JCL due to the 
dumb design of jdk logging but I believe it's possible.

So while I agree your proposal is sensible, I'd currently vote -0 on making 
this change to JCL due to compatibility issues, even on a 1.2 release. If 
there's enthusiasm for writing a 2.x release that has a new package name 
logging2 then that would avoid all compatibility issues, but I just can't see 
many people bothering to use such a thing.

Let's see if any other commons developers have an opinion on this

> Implement a Level class and a generic log method in Log
> -------------------------------------------------------
>
>                 Key: LOGGING-110
>                 URL: http://issues.apache.org/jira/browse/LOGGING-110
>             Project: Commons Logging
>          Issue Type: New Feature
>    Affects Versions: 1.0.4
>            Reporter: Sebastiaan van Erk
>
> The Log API does not have a generic log method and there is no generic Level 
> class. Since the levels which commons logging provides are fixed and since it 
> would not break backwards compatibiliy I would like to suggest that these are 
> added. To be more specific, I would like to see the following methods added:
>  void         log(Level level, Object message)
>            Log a message with the specified log level.
>  void         log(Level level, Object message, Throwable t)
>            Log a message and exception with the specified log level.
>  boolean isEnabled(Level level)
>            Is the specified logging level currently enabled?
> As an extra feature of the level class one could have string and integer 
> conversions to and from log levels.
> These features would allow one to use commons logging in more complex 
> situations without have to rely on specific logging implementations.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to