title: Using boost.log with printf-style macros
body: <p>I'm working on an application that uses an custom, platform-dependent logger.  The application defines some printf-style macros:</p>
  
  <pre><code>#define LOG_DEBUG(format, ...) \
    logger.log(DEBUG, __FUNCTION__, format, ##__VA_ARGS__)
  
  ...
  </code></pre>
  
  <p>The past few days I've been working on moving the application to use <code>boost.log</code>.  The biggest problem I'm having is trying to retain this macro format so that only the logger internals need to be changed, since boost's logging API is implemented in iostream-style, i.e.</p>
  
  <pre><code>BOOST_LOG(logger) &lt;&lt; "something";
  </code></pre>
  
  <ol>
  <li>Is there an easy way to provide a macro that takes printf-style args and prints them to the boost logger without having to use string buffers?  (I would think that having to format to a string would be a performance impact)</li>
  <li>If not, is there a way to format a string using <code>va_args</code> without having to <code>#ifdef</code> for different platform implementations of formatting functions? (this was the whole point of moving to boost.log in the first place)</li>
  </ol>