6594697 : varargs message and Throwable methods for java.util.Logger
A DESCRIPTION OF THE REQUEST :
It would be nice if there were printf-style, varargs methods for logging in the Logger class.
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:
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.
I think what we should have along these lines is something like this:
public void log(Level level, String msg, Throwable thrown, Object... params);
public void logp(Level level, String sourceClass, String sourceMethod, String msg, Throwable thrown, Object... params);
public void logrb(Level level, String sourceClass, String sourceMethod, String bundleName, String msg, Throwable thrown, Object... param);
It would be more general and satisfy the stated need well.