The java.text.MessageFormat is designed to be bi-directional (it parses as well as formats), which adds complexity and time. So there is definitely room for improvement in the performance. Both Ceki's {} processing and Onyx's processing (whose format is extended directly from the java.text.MessageFormat) are uni-directional formatters that are developed for speed.<div>
(*Chris*)<br><br><div class="gmail_quote">On Thu, Aug 2, 2012 at 9:31 AM, niels <span dir="ltr"><<a href="mailto:opensource21@gmail.com" target="_blank">opensource21@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
My question is, why the internal implementation doesn't use the<br>
standard-formatter class. Can't see any argument in<br>
logging_performance.<br>
Niels<br>
<br>
2012/8/2 Roman Muntyanu <<a href="mailto:rmuntyan@softserveinc.com">rmuntyan@softserveinc.com</a>>:<br>
<div class="HOEnZb"><div class="h5">>>> Furthermore I wonder what are the reasons that you don't use the Formatter-class of the JDK which has more possibilities.<br>
> Because of <a href="http://www.slf4j.org/faq.html#logging_performance" target="_blank">http://www.slf4j.org/faq.html#logging_performance</a><br>
><br>
> -----Original Message-----<br>
> From: <a href="mailto:slf4j-user-bounces@qos.ch">slf4j-user-bounces@qos.ch</a> [mailto:<a href="mailto:slf4j-user-bounces@qos.ch">slf4j-user-bounces@qos.ch</a>] On Behalf Of niels<br>
> Sent: Thursday, August 02, 2012 12:55 PM<br>
> To: <a href="mailto:slf4j-user@qos.ch">slf4j-user@qos.ch</a><br>
> Subject: [slf4j-user] Questions about formattedMessage<br>
><br>
> Hi<br>
> I restart thinking about to create a fluid-log-facade for java. The idea is to write log.onError().aMessage("test") or log.onDebug().aParmameter("param").withValue(1). One idea is to have something like formattedMessage("A {} test", "small"). I see that slf4j has something similar.<br>
> Unfortunately I found the the implementation not reliable enough. The problem is the following situation (I had in real-life last year, where a formatter was used): If you have formattedMessage("At {} the following error happens", "myMethod", e.getMessage()). So the devoloper has simply forget to add the {} at the messagepattern. Then the really important information is lost. Any change that the MessageFormatter will be changed, so that if L>argArray.length the additional array-information will simply added at the end?<br>
><br>
> Furthermore I wonder what are the reasons that you don't use the Formatter-class of the JDK which has more possibilities.<br>
><br>
> Best regards<br>
> Niels<br>
> _______________________________________________<br>
> slf4j-user mailing list<br>
> <a href="mailto:slf4j-user@qos.ch">slf4j-user@qos.ch</a><br>
> <a href="http://mailman.qos.ch/mailman/listinfo/slf4j-user" target="_blank">http://mailman.qos.ch/mailman/listinfo/slf4j-user</a><br>
> _______________________________________________<br>
> slf4j-user mailing list<br>
> <a href="mailto:slf4j-user@qos.ch">slf4j-user@qos.ch</a><br>
> <a href="http://mailman.qos.ch/mailman/listinfo/slf4j-user" target="_blank">http://mailman.qos.ch/mailman/listinfo/slf4j-user</a><br>
_______________________________________________<br>
slf4j-user mailing list<br>
<a href="mailto:slf4j-user@qos.ch">slf4j-user@qos.ch</a><br>
<a href="http://mailman.qos.ch/mailman/listinfo/slf4j-user" target="_blank">http://mailman.qos.ch/mailman/listinfo/slf4j-user</a><br>
</div></div></blockquote></div><br></div>