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


Struct template severity

boost::log::sources::severity — Severity level support feature.


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

template<typename LevelT = int> 
struct severity {
  // member classes/structs/unions
  template<typename BaseT> 
  struct apply {
    // types
    typedef basic_severity_logger< BaseT, LevelT > type;


The logger with this feature registers a special attribute with an integral value type on construction. This attribute will provide severity level for each log record being made through the logger. The severity level can be omitted on logging record construction, in which case the default level will be used. The default level can also be customized by passing it to the logger constructor.

The type of the severity level attribute can be specified as a template parameter for the feature template. By default, int will be used.