Extend the org.apache.commons.logging.Log interface for suitable use
--------------------------------------------------------------------

                 Key: LOGGING-121
                 URL: https://issues.apache.org/jira/browse/LOGGING-121
             Project: Commons Logging
          Issue Type: Improvement
    Affects Versions: 1.1.1
         Environment: Demands Java 1.5
            Reporter: Fábio Lima Santos
            Priority: Minor


For getting better source code legibility, I propose the extension of the 
org.apache.commons.logging.Log interface adding the methods above:

{{
        void trace(String message, Object... params);
        void trace(String message, Throwable t, Object... params);
        void debug(String message, Object... params);
        void debug(String message, Throwable t, Object... params);
        void info(String message, Object... params);
        void info(String message, Throwable t, Object... params);
        void warn(String message, Object... params);
        void warn(String message, Throwable t, Object... params);
        void error(String message, Object... params);
        void error(String message, Throwable t, Object... params);
        void fatal(String message, Object... params);
        void fatal(String message, Throwable t, Object... params);
}}

An example usage:

{{
        log.debug("This is the debug message number {0}!", 1);
}}

The implementation of this methods can use java.text.MessageFormat for 
translating the message and the parameters on the resultant log message, with 
low cost. An example implementation can be:

{{
        public void debug(String message, Object... params) {
                if (isDebugEnabled()) {
                        debug(MessageFormat.format(message, params));
                }
        }
}}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to