-
Enhancement
-
Resolution: Duplicate
-
P4
-
None
-
6
-
x86
-
windows_xp
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)
======================================================================
- duplicates
-
JDK-5001993 Use varargs in java.util.logging.Logger
-
- Open
-
- relates to
-
JDK-6263336 java.util.logging.Logger should be retrofitted to take advantage of varargs
-
- Closed
-