Boost C++ Libraries of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

This is the documentation for an old version of Boost. Click here to view this page for the latest version.

Class template basic_severity_logger

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


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

template<typename BaseT, typename LevelT = int> 
class basic_severity_logger : public BaseT {
  // types
  typedef base_type::char_type                                                                     char_type;           // Character type. 
  typedef base_type::final_type                                                                    final_type;          // Final type. 
  typedef base_type::threading_model                                                               threading_model;     // Threading model being used. 
  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< threading_model > >::type open_record_lock;    // Lock requirement for the open_record_unlocked method. 
  typedef unspecified                                                                              swap_lock;           // Lock requirement for the swap_unlocked method. 

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

  // public member functions
  severity_level default_severity() const;

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


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. basic_severity_logger(basic_severity_logger && that);

    Move constructor

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

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



    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. severity_attribute const & get_severity_attribute() const;

    Severity attribute accessor

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

    Unlocked open_record

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