[Log] Get the streams in a text_ostream_backend derived class
Hello, I have class StreamBackend : public boost::log::sinks::text_ostream_backend and manually instantiate the backend and add a stream boost::shared_ptr<StreamBackend> backend = boost::make_shared<StreamBackend>(); backend->add_stream(boost::shared_ptr<std::ostream>(new std::ofstream(some file name))); using sink_t = boost::log::sinks::synchronous_sink<StreamBackend>; boost::shared_ptr<sink_t> sink(new sink_t(backend)); sink->set_formatter(config.second.format); sink->set_filter(config.second.filter); boost::log::core::get()->add_sink(sink); All I want is to overwrite the consume function in the derived class. Since I want to retain the original functionality as far as possible, I would like to work on the streams added add_streams. Problem is that the m_pImpl->m_Streams vector in the implementation is private and there is no method to get the added streams. What is the best way to go here? Thanks, Florian
participants (1)
-
Florian Lindner