<p>Can we get the c++ equivalent of logback/slf4j? Avoiding string concat most of the time is the better option.</p>
<p>Marc-André Laverdière<br>
Sent from a mobile device, please  excuse the brevity</p>
<p><blockquote type="cite">On 23 Nov 2011 11:56, &quot;Lubos Lunak&quot; &lt;<a href="mailto:l.lunak@suse.cz">l.lunak@suse.cz</a>&gt; wrote:<br><br><p><font color="#500050">On Wednesday 23 of November 2011, Michael Meeks wrote:</font></p>
<p><font color="#500050">&gt; On Wed, 2011-11-23 at 14:56 +0100, Lubos Lunak wrote:</font></p><p><font color="#500050">&gt; &gt;  And some of the arguments are rather weak as well, I can get you easy to<br>&gt; &gt; use and read, bett...</font></p>
 I haven&#39;t thought it out in detail, but the general idea is attached. It&#39;s<br>
just a proof of concept, so there are some obvious problems, but I don&#39;t see<br>
a flaw in the design. Since it&#39;s also just a single call, the in-place cost<br>
is small and is moved to the bodies of the templates, which can be just in<br>
one place, one per each combination of arguments (and the common instances of<br>
the template can be externed, so it really will be just one copy). The<br>
template code is relatively small, so I don&#39;t expect noticeable impact on<br>
compile time. Also, funnily enough, the generated code in the place of the<br>
call is one instruction shorter, because unlike printf() it does not need the<br>
terminating NULL for the vararg :).<br>
<br>
 I expect it would be even possible to achieve such single in-place call even<br>
for the LOG( &quot;P is &quot; &lt;&lt; p &lt;&lt; &quot; and b is &quot; &lt;&lt; b ) case, or even do this for<br>
string+string operation, which would turn it into the even better-looking<br>
LOG( &quot;P is &quot; + p + &quot; and b is &quot; b ) or LOG( &quot;P is %1 and b is %2&quot;, p, b ),<br>
whichever would suit one&#39;s fancy (as in, both would be possible at the same<br>
time). It would require getting a bit more creative with argument and return<br>
types for the operator overloads, but that&#39;d be hidden behind the scenes.<br>
<font color="#888888"><br>
--<br>
 Lubos Lunak<br>
 <a href="mailto:l.lunak@suse.cz">l.lunak@suse.cz</a><br>
</font><br>_______________________________________________<br>
LibreOffice mailing list<br>
<a href="mailto:LibreOffice@lists.freedesktop.org">LibreOffice@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/libreoffice" target="_blank">http://lists.freedesktop.org/mailman/listinfo/libreoffice</a><br>
<br></blockquote></p>