[slf4j-user] feature request: LOG.debugFormat("This is a number %f", someFloat)

Thomas Oellrich toellrich at gmail.com
Sun Feb 19 19:57:54 CET 2012


It would also be possible to only support %s, not the full range of
formatting options, just like Google Guava's Precondition class does
it:

http://docs.guava-libraries.googlecode.com/git/javadoc/com/google/common/base/Preconditions.html

I, too, would welcome such an addition since it's cumbersome having to
remember to use %s when using Preconditions and String.printf, but {}
when logging in SLF4J. A better name, though, might be Logger.debugf
just as used by JBOSS' Logging API.

Cheers,

Thomas


On Feb 7, 2012, at 5:46 PM, Roman Muntyanu wrote:

>* Well, ‘{}’ is “only supported” for performance considerations, current formatting implementation outperforms String.format() at 10 times.*>* http://www.slf4j.org/faq.html#logging_performance*>* so it’s unlikely to change*>*  *>* From: slf4j-user-bounces at qos.ch <http://mailman.qos.ch/mailman/listinfo/slf4j-user> [mailto:slf4j-user-bounces at qos.ch <http://mailman.qos.ch/mailman/listinfo/slf4j-user>] On Behalf Of Chris Pratt*>* Sent: Tuesday, February 07, 2012 18:19 PM*>* To: User list for the slf4j project*>* Subject: Re: [slf4j-user] feature request: LOG.debugFormat("This is a number %f", someFloat)*>*  *>* I think you should look at the Onyx project http://code.google.com/p/Anodyzed.*>*   (*Chris *)*>* *>* On Feb 7, 2012 7:47 AM, "Christoph Pickl" <Christoph.Pickl at techtalk.at <http://mailman.qos.ch/mailman/listinfo/slf4j-user>> wrote:*>* hi guys,*>* *>* i came up with an idea:*>* you know this String.format("whatever") method? which behaves like C's formatf?*>* wouldn't it be nice to be able to use exactly this format string for logging?*>* until now, it only supports "{}" for argument replacement...*>* *>* what do you think?*>* *>* *>* kr, and keep up the good work,*>* ~christoph*>* *>* _______________________________________________*>* slf4j-user mailing list*>* slf4j-user at qos.ch <http://mailman.qos.ch/mailman/listinfo/slf4j-user>*>* http://mailman.qos.ch/mailman/listinfo/slf4j-user*>* _______________________________________________*>* slf4j-user mailing list*>* slf4j-user at qos.ch <http://mailman.qos.ch/mailman/listinfo/slf4j-user>*>* http://mailman.qos.ch/mailman/listinfo/slf4j-user*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.qos.ch/pipermail/slf4j-user/attachments/20120219/30e52b0a/attachment.html>


More information about the slf4j-user mailing list