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

Request for variable parameter version of Logger.log(Level, String, Object[])

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 6
    • core-libs



      Name: gm110360 Date: 05/13/2004


      A DESCRIPTION OF THE REQUEST :
      First, thanks for creating the logging utilities and keep improving it! It's good, easy to use, and well documented (I think).

      We can use log(Level, String, Object[]) to log a customizable and internationized message. It's customizable in that special tags in the message will be replaced by values in the last Object[] parameter.

      This is useful, but sometimes (more often then not?) the parameters does not come in form of array. In such a case, the developer have to build an array first.

      The variable parameter feature introduced in Tiger can make it easier.

      The present version should be preserved, however, for in case of multiple primitive parameters of the same type, autoboxing makes the array version much simpler.

      JUSTIFICATION :
      If a overload method log(Level, String, Object ... []) is present, it may save developer the trouble of creating another array and can focus on throwing in what it need most. It also improves readibility, leading to code that is easier to understand and maintain.


      ---------- BEGIN SOURCE ----------
      Example:
      from: log( Level.INFO, "File {0} parsed in {1} ms", new Object [] { fileName, new Long ( time ) } );
      to: log( Level.INFO, "File {0} parsed in {1} ms", fileName, new Long(time) );
      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      I'm tempted to write my own utility for the logger.
      (Incident Review ID: 265390)
      ======================================================================

            Unassigned Unassigned
            gmanwanisunw Girish Manwani (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: