title: How to enable/disable spdlog logging in code?
body: <p>I am creating c++ library modules in my application.  To do logging, I use <a href="https://github.com/gabime/spdlog" rel="noreferrer">spdlog</a>.  But in a production environment, I don't want my lib modules to do any logging.  One way to achieve turning on/off would be to litter my code with #ifdef conditionals like...</p>
  
  <pre><code>#ifdef logging
    // call the logger here.
  #endif
  </code></pre>
  
  <p>I am looking for a way to avoid writing these conditionals.  May be a wrapper function that does the #ifdef checking and write it.  But the problem with this approach is that I have to write wrappers for every logging method (such as info, trace, warn, error, ...)</p>
  
  <p>Is there a better way?</p>