Boost C++ Libraries

...one 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.
PrevUpHomeNext

Class text_multifile_backend

boost::log::sinks::text_multifile_backend — An implementation of a text multiple files logging sink backend.

Synopsis

// 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 &);
};

Description

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 construct/copy/destruct

  1. text_multifile_backend();

    Default constructor. The constructed sink backend has no file name composer and thus will not write any files.

  2. ~text_multifile_backend();

    Destructor

text_multifile_backend public member functions

  1. template<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:

    composer

    File name composer functor

  2. void consume(record_view const & rec, string_type const & formatted_message);

    The method writes the message to the sink


PrevUpHomeNext