...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::sinks::basic_sink_frontend — A base class for a logging sink frontend.
// In header: <boost/log/sinks/basic_sink_frontend.hpp> class basic_sink_frontend : public sink { public: // types typedef base_type::exception_handler_type exception_handler_type; // An exception handler type. // construct/copy/destruct explicit basic_sink_frontend(bool); // public member functions template<typename FunT> void set_filter(FunT const &); void reset_filter(); template<typename FunT> void set_exception_handler(FunT const &); void reset_exception_handler(); virtual bool will_consume(attribute_value_set const &); // protected member functions mutex_type & frontend_mutex() const; exception_handler_type & exception_handler(); exception_handler_type const & exception_handler() const; template<typename BackendMutexT, typename BackendT> void feed_record(record_view const &, BackendMutexT &, BackendT &); template<typename BackendMutexT, typename BackendT> bool try_feed_record(record_view const &, BackendMutexT &, BackendT &); template<typename BackendMutexT, typename BackendT> void flush_backend(BackendMutexT &, BackendT &); // private member functions template<typename BackendMutexT, typename BackendT> void flush_backend_impl(BackendMutexT &, BackendT &, mpl::true_); template<typename BackendMutexT, typename BackendT> void flush_backend_impl(BackendMutexT &, BackendT &, mpl::false_); };
basic_sink_frontend
public member functionstemplate<typename FunT> void set_filter(FunT const & filter);
The method sets sink-specific filter functional object
void reset_filter();
The method resets the filter
template<typename FunT> void set_exception_handler(FunT const & handler);
The method sets an exception handler function
void reset_exception_handler();
The method resets the exception handler function
virtual bool will_consume(attribute_value_set const & attrs);
The method returns true
if no filter is set or the attribute values pass the filter
Parameters: |
|
basic_sink_frontend
protected member functionsmutex_type & frontend_mutex() const;Returns reference to the frontend mutex.
exception_handler_type & exception_handler();Returns reference to the exception handler.
exception_handler_type const & exception_handler() const;Returns reference to the exception handler.
template<typename BackendMutexT, typename BackendT> void feed_record(record_view const & rec, BackendMutexT & backend_mutex, BackendT & backend);Feeds log record to the backend.
template<typename BackendMutexT, typename BackendT> bool try_feed_record(record_view const & rec, BackendMutexT & backend_mutex, BackendT & backend);Attempts to feeds log record to the backend, does not block if backend_mutex is locked.
template<typename BackendMutexT, typename BackendT> void flush_backend(BackendMutexT & backend_mutex, BackendT & backend);Flushes record buffers in the backend, if one supports it.
basic_sink_frontend
private member functionstemplate<typename BackendMutexT, typename BackendT> void flush_backend_impl(BackendMutexT & backend_mutex, BackendT & backend, mpl::true_);Flushes record buffers in the backend (the actual implementation)
template<typename BackendMutexT, typename BackendT> void flush_backend_impl(BackendMutexT &, BackendT &, mpl::false_);Flushes record buffers in the backend (stub for backends that don't support flushing)