Uploaded image for project: 'Commons Logging'
  1. Commons Logging
  2. LOGGING-121

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

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Duplicate
    • 1.1.1
    • None
    • None
    • Demands Java 1.5

    Description

      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)); }

      }

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              flsusp Fábio Lima Santos
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: