Boost C++ Libraries

PrevUpHomeNext

Class template fmt_named_scope

boost::log::formatters::fmt_named_scope — Named scope attribute formatter.

Synopsis

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

template<typename CharT, typename ExceptionPolicyT> 
class fmt_named_scope :
  public basic_formatter< CharT, fmt_named_scope< CharT, 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. 
  typedef attributes::basic_named_scope< char_type >::scope_stack scope_stack;   // Scope stack container type. 

  // construct/copy/destruct
  template<typename T1, typename T2> 
    fmt_named_scope(T1 const &, T2 const &, typename scope_stack::size_type, 
                    scope_iteration_direction);

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

  // private member functions
  void format(ostream_type &, scope_stack const &) const;
};

Description

The formatter iterates through the list of scopes and puts each one into the resulting stream. The formatter supports customizing the iteration direction, depth and delimiter between the scopes.

fmt_named_scope public construct/copy/destruct

  1. template<typename T1, typename T2> 
      fmt_named_scope(T1 const & name, T2 const & delimiter, 
                      typename scope_stack::size_type max_scopes, 
                      scope_iteration_direction direction);

    Constructor

    Parameters:
    delimiter

    Scope delimiter string

    direction

    Scope iteration direction

    max_scopes

    Maximum scope iteration depth

    name

    Attribute name

fmt_named_scope public member functions

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

    Formatting operator. Acquires the scope list attribute value with the name specified on the formatter construction from record and puts its contents 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

fmt_named_scope private member functions

  1. void format(ostream_type & strm, scope_stack const & scopes) const;
    The function performs formatting of the extracted scope stack.

PrevUpHomeNext