title: boost::log setting "Channel" attribute in a channel logger
body: <p>I use several <code>severity_channel_logger_mt</code> instances throughout the project with different "Channel" attributes. However, for one specific log line, I'd like to set the "Channel" attribute directly in the call. Using the macro <code>BOOST_LOG_CHANNEL_SEV(logger, channel, severity)</code>, this is actually not difficult to do. However, this changes the "Channel" attribute. Subsequent logging calls will not use the initial channel attribute, but the changed one from the last logging call. </p>
  
  <p>The only way I found to change the channel attribute back to the original value is: to mis-use the <code>open_record()</code> function of the logger object.</p>
  
  <p>My Question: <strong>is there a more elegant way of doing this?</strong> Is there perhaps a specific function that allows setting attributes of a logger directly?</p>
  
  <p>Code snippet to highlight the procedure:</p>
  
  <pre><code>auto &amp; lg = global_logger::get();
  BOOST_LOG_CHANNEL_SEV(lg, "test-subsystem",  exec_severity) &lt;&lt; "Message 1";
  
  // misuse the open_record call to set the channel attribute
  // reset channel name back to "global"
  auto rc = lg.open_record(boost::log::keywords::channel = "global" );
  rc.reset();  // attempt to clean-up a bit
  
  BOOST_LOG_CHANNEL(lg, exec_severity) &lt;&lt; "Message 2";
  </code></pre>
  
  <p>In the above example, "Message 1" shall come from "test-subsystem", but the other messages shall come from "global" channel. If the <code>open_record()</code> and <code>rc.reset();</code> lines are commented out, both messages come from the "test-system"</p>
  
  <hr>
  
  <p><strong>Update:</strong></p>
  
  <p>I ended up implementing a slightly different solution</p>
  
  <ul>
  <li>I created a dedicated logger for these log messages</li>
  <li>I use <code>BOOST_LOG_CHANNEL_SEV()</code> to log to this logger which takes an argument to set the "Channel" name on each call</li>
  </ul>
  
  <p>The updated code snippet from above looks like this:</p>
  
  <pre><code>auto &amp; stlog = global_logger::get();
  auto &amp; lg = special_logger::get();
  BOOST_LOG_CHANNEL_SEV(lg, "test-subsystem",  exec_severity) &lt;&lt; "Message 1";
  
  // this log line will be in channel "global" again
  BOOST_LOG_SEV(stlog, exec_severity) &lt;&lt; "Message 2";
  </code></pre>