Boost C++ Libraries

PrevUpHomeNext

Class template fmt_attr

boost::log::formatters::fmt_attr — Generic attribute value formatter.

Synopsis

// In header: <boost/log/formatters/attr.hpp>

template<typename CharT, typename AttributeValueTypesT, 
         typename ExceptionPolicyT> 
class fmt_attr : public basic_formatter< CharT, fmt_attr< 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 base_type::record_type  record_type;   // Log record type. 

  // construct/copy/destruct
  explicit fmt_attr(string_type const &);

  // public member functions
  void operator()(ostream_type &, record_type const &) const;
};

Description

The fmt_attr formatter attempts to convert the attribute value to a string by putting it into a stream. The final representation of the value is totally defined by the operator<< overload implementation.

The formatter can either accept a single attribute value type or a sequence of types.

fmt_attr public construct/copy/destruct

  1. explicit fmt_attr(string_type const & name);

    Constructor

    Parameters:
    name

    Attribute name

fmt_attr public member functions

  1. void operator()(ostream_type & strm, record_type const & record) const;

    Formatting operator. Puts the attribute with the specified on construction name from attrs into the strm stream.

    Parameters:
    record

    A logging record

    strm

    A reference to the stream, where the final text of the logging record is composed


PrevUpHomeNext