title: How to query boost::log severity?
body: <p>I'm using trivial logging of <a href="http://www.boost.org/doc/libs/1_62_0/libs/log/doc/html/index.html" rel="nofollow noreferrer">boost::log</a> library and I want to execute some code depending on currently set logger severity. This is needed for constructing of log message only if it will be outputted. But I cannot find the right way for querying severity. The code must be something like:</p>
  
  <pre><code>if (boost::log::trivial::severity &lt;=
      boost::log::trivial::severity_level::trace)
  {
    // construct log message
    BOOST_LOG_TRIVIAL(trace) &lt;&lt; message;
  }
  </code></pre>
  
  <p>In addition may be there is some way when I know that the message will be outputted to avoid double checking of severity and output it directly instead of using <code>BOOST_LOG_TRIVIAL</code> macro?</p>