title: Can I copy a Boost::Log sink and change it?
body: <p>I'm currently creating a log sink that dumps log lines from the output of my <code>Trainer</code> class to <code>cout</code>:</p>
  
  <pre><code>    using namespace boost;                                                      
      using namespace log;                                                        
      using namespace expressions;                                                
      using namespace sinks;                                                      
  
      auto sink = make_shared&lt;synchronous_sink&lt;text_ostream_backend&gt;&gt;();          
  
      sink-&gt;set_formatter(Utility::GetLoggingFormat());                           
  
      sink-&gt;locked_backend()-&gt;add_stream(                                         
          shared_ptr&lt;std::ostream&gt;(&amp;std::cout, null_deleter()));                  
      sink-&gt;set_filter((                                                          
          has_attr(Utility::ClassTag) &amp;&amp;                                          
          Utility::ClassTag == "App::Trainer"));                                  
      boost::log::core::get()-&gt;add_sink(sink);                                    
  </code></pre>
  
  <p>However, I have already added a sink (by calling <code>add_file_log</code> elsewhere) that dumps all log lines to a file. It uses the same <code>GetLoggingFormat()</code> formatter. In fact, the only reason I have that function is so that I don't have to repeat the formatter code.</p>
  
  <p>Instead, I'd prefer to just "copy" the file sink (created elsewhere with <code>add_file_log</code>), change its output to <code>std::cout</code> and add the filter to it.</p>
  
  <p>Can I do this?</p>