title: How to wrap printf() into a function or macro?
body: <p>This might sound like an interview question but is actually a practical problem.</p>
  <p>I am working with an embedded platform, and have available only the equivalents of those functions:</p>
  <ul>
  <li>printf()</li>
  <li>snprintf()</li>
  </ul>
  <p>Furthermore, the <code>printf()</code> implementation (and signature) is likely to change in the near future, so calls to it have to reside in a separate module in order to be easy to migrate later.</p>
  <p>Given that, can I wrap logging calls in some function or macro? The goal is that my source code calls <code>THAT_MACRO(&quot;Number of bunnies: %d&quot;, numBunnies);</code> in a thousand places, but calls to the above functions are seen only in a single place.</p>
  <p>Compiler: <code>arm-gcc -std=c99</code></p>
  <p>Edit: just to mention, but post 2000 best practices and probably a lot earlier, inline functions are far better than macros for numerous reasons.</p>