RFR 2: JDK-8005263: Logging APIs takes Supplier<String> for message

Jason Mehrens jason_mehrens at hotmail.com
Sat Dec 22 07:30:59 PST 2012


The msg argument in most cases is a string literal because it is either a resource bundle key or a MessageFormat literal.  The established best practice is to convert on the fly construction of messages to use the MessageFormat syle logging.  This current patch is kind of anti-pattern of that practice.  I would think the real win would be to delay construction of the 'params' argument in the logging framework.  Allowing the callers to write logger.log(level, "{0}", Foo::bar) and have the call to bar be lazy eval would be the best of both the logging world and the lambda world. Jason
 > Date: Fri, 21 Dec 2012 20:50:18 -0800
> From: henry.jen at oracle.com
> To: core-libs-dev at openjdk.java.net; lambda-dev at openjdk.java.net
> Subject: RFR 2: JDK-8005263: Logging APIs takes Supplier<String> for message
> 
> Hi,
> 
> Update patch with review feedback,
> - JavaDoc update for benefit and gotcha.
> - logEx/logpEx is not log/logp with Supplier<String> as last argument.
> As a matter of fact, all API with Supplier<String> takes it as last
> argument.
> - No more doLog(Level, Supplier<String>, Block<LogRecord>) helper for
> performance concerns.
> 
> Specdiff and webrev can be found at following,
> 
> http://cr.openjdk.java.net/~henryjen/ccc/8005263.1/specdiff/diff.html
> http://cr.openjdk.java.net/~henryjen/ccc/8005263.1/webrev/
> 
> Cheers,
> Henry
> 
 		 	   		  


More information about the lambda-dev mailing list