boost::log::sinks::sink — A base class for a logging sink frontend.
// In header: <boost/log/sinks/sink.hpp> template<typename CharT> class sink : private noncopyable { public: // types typedef CharT char_type; // Character type. typedef std::basic_string< char_type > string_type; // String type to be used as a message text holder. typedef basic_record< char_type > record_type; // Log record type. typedef basic_attribute_values_view< char_type > values_view_type; // Attribute values view type. typedef function1< bool, values_view_type const & > filter_type; // Filter function type. typedef function0< void > exception_handler_type; // An exception handler type. // construct/copy/destruct ~sink(); // public member functions bool will_consume(values_view_type const &); void consume(record_type const &); bool try_consume(record_type const &); };
sink
public member functionsbool will_consume(values_view_type const & attributes);
The method returns true
if no filter is set or the attribute values pass the filter
Parameters: |
|
void consume(record_type const & record);
The method puts logging message to the sink
Parameters: |
|
bool try_consume(record_type const & record);
The method attempts to put logging message to the sink. The method may be used by the core in order to determine the most efficient order of sinks to feed records to in case of heavy contention. Sink implementations may implement try/backoff logic in order to improve overall logging throughput.
Parameters: |
|
||
Returns: |
|