Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6594697

varargs message and Throwable methods for java.util.Logger

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Unresolved
    • Icon: P3 P3
    • tbd
    • 7
    • core-libs

      A DESCRIPTION OF THE REQUEST :
      It would be nice if there were printf-style, varargs methods for logging in the Logger class.

      JUSTIFICATION :
      Being able to specify: logger.log(Level.DEBUG, "yada yada %s %s %s", s1, s2, s3, ex); Could increase performance by allowing the string concat & formatting to only take place if the debug level enable. This would clean up a lot of code that currently does:

      if(logger.isDebugEnabled() {
         logger.log(level.DEBUG, "yada yada" + s1 + s2 + s3", ex);
      }

      If the last argument in the vararg list is a throwable, then it could be considered the "thrown" argument.

            dfuchs Daniel Fuchs
            ndcosta Nelson Dcosta (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Imported:
              Indexed: