Boost C++ Libraries

PrevUpHomeNext

Class template basic_severity_logger

boost::log::sources::basic_severity_logger — Severity level feature implementation.

Synopsis

// In header: <boost/log/sources/severity_feature.hpp>

template<typename BaseT, typename LevelT = int> 
class basic_severity_logger {
public:
  // types
  typedef base_type::char_type                                                                 char_type;           // Character type. 
  typedef base_type::final_type                                                                final_type;          // Final type. 
  typedef base_type::attribute_set_type                                                        attribute_set_type;  // Attribute set type. 
  typedef base_type::threading_model                                                           threading_model;     // Threading model being used. 
  typedef base_type::record_type                                                               record_type;         // Log record type. 
  typedef LevelT                                                                               severity_level;      // Severity level type. 
  typedef unspecified                                                                          severity_attribute;  // Severity attribute type. 
  typedef strictest_lock< typename base_type::open_record_lock, no_lock >::type                open_record_lock;    // Lock requirement for the open_record_unlocked method. 
  typedef strictest_lock< typename base_type::swap_lock, lock_guard< threading_model > >::type swap_lock;           // Lock requirement for the swap_unlocked method. 

  // construct/copy/destruct
  basic_severity_logger();
  basic_severity_logger(basic_severity_logger const &);
  template<typename ArgsT> explicit basic_severity_logger(ArgsT const &);

  // public member functions
  severity_level default_severity() const;

  // protected member functions
  shared_ptr< severity_attribute > const & get_severity_attribute() const;
  template<typename ArgsT> record_type open_record_unlocked(ArgsT const &);
  void swap_unlocked(basic_severity_logger &);
};

Description

basic_severity_logger public construct/copy/destruct

  1. basic_severity_logger();

    Default constructor. The constructed logger will have a severity attribute registered. The default level for log records will be 0.

  2. basic_severity_logger(basic_severity_logger const & that);

    Copy constructor

  3. template<typename ArgsT> explicit basic_severity_logger(ArgsT const & args);

    Constructor with named arguments. Allows to setup the default level for log records.

    Parameters:
    args

    A set of named arguments. The following arguments are supported:

    • severity - default severity value

basic_severity_logger public member functions

  1. severity_level default_severity() const;

    Default severity value getter

basic_severity_logger protected member functions

  1. shared_ptr< severity_attribute > const & get_severity_attribute() const;

    Severity attribute accessor

  2. template<typename ArgsT> record_type open_record_unlocked(ArgsT const & args);

    Unlocked open_record

  3. void swap_unlocked(basic_severity_logger & that);
    Unlocked swap.

PrevUpHomeNext