[
http://issues.apache.org/jira/browse/LOGGING-110?page=comments#action_12450998
]
Sebastiaan van Erk commented on LOGGING-110:
--------------------------------------------
One more comment on the implementation using only the commons logging API
itself: this need only be done for libraries that do NOT support these methods
natively (which are in the minority I would think).
For log4j for example, you would just need a static mapping from commons log
priorities to log4j log levels, which can be implemented efficiently with an
array:
Level levels[] = new Level[] { Level.TRACE, Level.DEBUG, ... }
and one can just call the underlying Logger.log(levels[priority.byteValue()],
message) or something like that.
This would not be much of a performance hit at all.
> 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]