...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
boost::log::sources::basic_channel_logger — Channel feature implementation.
// In header: <boost/log/sources/channel_feature.hpp> template<typename BaseT, typename ChannelT> class basic_channel_logger : public BaseT { public: // 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 ChannelT channel_type; // Channel type. typedef attributes::mutable_constant< channel_type > channel_attribute; // Channel attribute type. typedef unspecified open_record_lock; // Lock requirement for theopen_record_unlocked
method. typedef unspecified swap_lock; // Lock requirement for theswap_unlocked
method. // member classes/structs/unions // Default channel name generator. struct make_default_channel_name { // types typedef channel_type result_type; // public member functions result_type operator()() const; }; // public member functions basic_channel_logger(); basic_channel_logger(basic_channel_logger const &); basic_channel_logger(basic_channel_logger &&) noexcept(boost::is_nothrow_move_constructible< base_type >::value &&boost::is_nothrow_move_constructible< channel_attribute >::value); template<typename ArgsT> explicit basic_channel_logger(ArgsT const &); channel_type channel() const; void channel(channel_type const &); // protected member functions channel_attribute const & get_channel_attribute() const; template<typename ArgsT> record open_record_unlocked(ArgsT const &); void swap_unlocked(basic_channel_logger &); // private member functions template<typename ArgsT, typename T> record open_record_with_channel_unlocked(ArgsT const &, T const &); template<typename ArgsT> record open_record_with_channel_unlocked(ArgsT const &, parameter::void_); };
basic_channel_logger
public member functionsbasic_channel_logger();
Default constructor. The constructed logger has the default-constructed channel name.
basic_channel_logger(basic_channel_logger const & that);
Copy constructor
basic_channel_logger(basic_channel_logger && that) noexcept(boost::is_nothrow_move_constructible< base_type >::value &&boost::is_nothrow_move_constructible< channel_attribute >::value);
Move constructor
template<typename ArgsT> explicit basic_channel_logger(ArgsT const & args);
Constructor with arguments. Allows to register a channel name attribute on construction.
Parameters: |
|
channel_type channel() const;
The observer of the channel name
Returns: |
The channel name that was set by the logger |
void channel(channel_type const & ch);
The setter of the channel name
Parameters: |
|
basic_channel_logger
protected member functionschannel_attribute const & get_channel_attribute() const;
Channel attribute accessor
template<typename ArgsT> record open_record_unlocked(ArgsT const & args);
Unlocked open_record
void swap_unlocked(basic_channel_logger & that);
Unlocked swap
basic_channel_logger
private member functionstemplate<typename ArgsT, typename T> record open_record_with_channel_unlocked(ArgsT const & args, T const & ch);The
open_record
implementation for the case when the channel is specified in log statement. template<typename ArgsT> record open_record_with_channel_unlocked(ArgsT const & args, parameter::void_);The
open_record
implementation for the case when the channel is not specified in log statement.