boost::log::formatters::fmt_format — Formatter to output objects into a Boost.Format object.
// In header: <boost/log/formatters/format.hpp> template<typename CharT> class fmt_format : public basic_formatter< CharT, fmt_format< CharT > > { public: // types typedef base_type::char_type char_type; // Character type. typedef base_type::string_type string_type; // String type. typedef base_type::ostream_type ostream_type; // Stream type. typedef basic_format< char_type > format_type; // Boost.Format type. typedef base_type::record_type record_type; // Log record type. // construct/copy/destruct explicit fmt_format(format_type const &); fmt_format(fmt_format const &); fmt_format& operator=(fmt_format const &); // public member functions void operator()(ostream_type &, record_type const &) const; template<typename T> fmt_format< char_type > & operator%(T const &); };
The fmt_format
class template is a hook that allows to construct formatters with format strings. The formatter basically accumulates formatters of the formatting expression and invokes them sequentially when called to format a log record. The results of the aggregated formatters are fed to a Boost.Format formatter instance. The final result of formatting is put into the resulting stream.
fmt_format
public
construct/copy/destructexplicit fmt_format(format_type const & fmt);
Constructor with formatter initialization
Parameters: |
|
fmt_format(fmt_format const & that);
Copy constructor
fmt_format& operator=(fmt_format const & that);Assignment prohibited.
fmt_format
public member functionsvoid operator()(ostream_type & strm, record_type const & record) const;
Formatting operator. Invokes all aggregated formatters, collects their formatting results and composes them according to the format string passed on construction.
Parameters: |
|
template<typename T> fmt_format< char_type > & operator%(T const & fmt);
Composition operator. Consumes the fmt formatter.
Parameters: |
|