...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
boost::log::sinks::text_multifile_backend — An implementation of a text multiple files logging sink backend.
// In header: <boost/log/sinks/text_multifile_backend.hpp> class text_multifile_backend : public basic_formatted_sink_backend< char > { public: // types typedef base_type::char_type char_type; // Character type. typedef base_type::string_type string_type; // String type to be used as a message text holder. typedef unspecified file_name_composer_type; // File name composer functor type. // construct/copy/destruct text_multifile_backend(); ~text_multifile_backend(); // public member functions template<typename ComposerT> void set_file_name_composer(ComposerT const &); void consume(record_view const &, string_type const &); };
The sink backend puts formatted log records to one of the text files. The particular file is chosen upon each record's attribute values, which allows to distribute records into individual files or to group records related to some entity or process in a separate file.
text_multifile_backend
public member functionstemplate<typename ComposerT> void set_file_name_composer(ComposerT const & composer);
The method sets file name composer functional object. Log record formatters are accepted, too.
Parameters: |
|
void consume(record_view const & rec, string_type const & formatted_message);
The method writes the message to the sink