I think it will be difficult to adapt all layouts (and appenders without layouts) to use StringBuilderFormattable.formatTo(StringBuilder) instead of String Message.getFormattedMessage().
I suggest we add another method to StringBuilderFormattable: CharSequence getFormattedMessageBuffer(); // feel free to suggest a better name That method could just return the StringBuilder, and be equally allocation free. The each layout / appender can use whichever method is easiest in that case. I am looking at GelfLayout, and it would be easier to use a method returning a CharSequence instead of formatTo(StringBuilder). On Tue, Mar 22, 2016 at 4:50 PM, Mikael Ståldal <[email protected]> wrote: > Should we to the trimming in getFormattedMessage() as well as in > toFormat()? > > On Tue, Mar 22, 2016 at 4:38 PM, Remko Popma <[email protected]> > wrote: > >> Thanks! Done. >> >> Sent from my iPhone >> >> On 2016/03/23, at 0:10, Mikael Ståldal <[email protected]> wrote: >> >> I think that RingBufferLogEvent#StringBuilderWrapperMessage need to have >> a proper implementation of getFormattedMessage(), otherwise layouts and >> appenders which does not use formatTo() will not work. >> >> -- >> [image: MagineTV] >> >> *Mikael Ståldal* >> Senior software developer >> >> *Magine TV* >> [email protected] >> Grev Turegatan 3 | 114 46 Stockholm, Sweden | www.magine.com >> >> Privileged and/or Confidential Information may be contained in this >> message. If you are not the addressee indicated in this message >> (or responsible for delivery of the message to such a person), you may >> not copy or deliver this message to anyone. In such case, >> you should destroy this message and kindly notify the sender by reply >> email. >> >> > > > -- > [image: MagineTV] > > *Mikael Ståldal* > Senior software developer > > *Magine TV* > [email protected] > Grev Turegatan 3 | 114 46 Stockholm, Sweden | www.magine.com > > Privileged and/or Confidential Information may be contained in this > message. If you are not the addressee indicated in this message > (or responsible for delivery of the message to such a person), you may not > copy or deliver this message to anyone. In such case, > you should destroy this message and kindly notify the sender by reply > email. > -- [image: MagineTV] *Mikael Ståldal* Senior software developer *Magine TV* [email protected] Grev Turegatan 3 | 114 46 Stockholm, Sweden | www.magine.com Privileged and/or Confidential Information may be contained in this message. If you are not the addressee indicated in this message (or responsible for delivery of the message to such a person), you may not copy or deliver this message to anyone. In such case, you should destroy this message and kindly notify the sender by reply email.
