printf - source of bugs?
<p>I'm using a lot of <code>printf</code> for tracing/logging purposes in my code, I've found that it's a source of programming error. I always found the insertion operator (<code>&lt;&lt;</code>) to be somewhat of a odd thing but I'm beginning to think that by using it instead I could avoid some of these bugs.</p>

<p>Anyone ever had a similar revelation or I'm just grasping at straws here?</p>

<h1>Some take away points</h1>

<ul>
<li>My current line of thinking is that type-safety outweighs any benefit
of using printf. The real problem is the format string and the use of
non type-safe variadic functions.</li>
<li>Maybe I won't be using <code>&lt;&lt;</code> and the stl output stream variants but I will certainly look into using a type-safe mechanism which is very similar.</li>
<li>A lot of the tracing/logging is conditional but I'd like to always run the code to not miss bugs in tests just because it's a rarely taken branch.</li>
</ul>
