Boost C++ Libraries of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

This is the documentation for an old version of boost. Click here for the latest Boost documentation.

Function template register_sink_factory

boost::log::register_sink_factory — The function registers a factory for a custom sink.


// In header: <boost/log/utility/setup/from_settings.hpp>

template<typename FactoryT> 
  enable_if< is_base_and_derived< sink_factory< typename FactoryT::char_type >, FactoryT >>::type 
  register_sink_factory(std::string const & sink_name, 
                        shared_ptr< FactoryT > const & factory);


The function registers a factory for a sink. The factory will be called to create sink instance when the parser discovers the specified sink type in the settings file. The factory must accept a map of parameters [parameter name -> parameter value] that it may use to initialize the sink. The factory must return a non-NULL pointer to the constructed sink instance.



Pointer to the custom sink factory. Must not be NULL.


The custom sink name