boost::log::formatters::fmt_attr_formatted — Generic attribute value formatter.
// In header: <boost/log/formatters/attr.hpp> template<typename CharT, typename AttributeValueTypesT, typename ExceptionPolicyT> class fmt_attr_formatted : public basic_formatter< CharT, fmt_attr_formatted< CharT, AttributeValueTypesT, ExceptionPolicyT > > { 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 object type. typedef base_type::record_type record_type; // Log record type. // construct/copy/destruct explicit fmt_attr_formatted(string_type const &, string_type const &); // public member functions void operator()(ostream_type &, record_type const &) const; };
The fmt_attr_formatted
formatter converts the attribute value to a string by passing it to a Boost.Format formatter. The formatter is initialized with a format string that may specify the exact representation of the formatted data.
The formatter can either accept a single attribute value type or a sequence of types.
fmt_attr_formatted
public
construct/copy/destructexplicit fmt_attr_formatted(string_type const & name, string_type const & fmt);
Constructor with attribute name and format string initialization
Parameters: |
|
fmt_attr_formatted
public member functionsvoid operator()(ostream_type & strm, record_type const & record) const;
Formatting operator. Formats the attribute with the specified on construction name from attrs and puts the result into the strm stream.
Parameters: |
|