A base class for a logging sink frontend. More...
#include <sink.hpp>
Public Types | |
typedef boost::log::aux::light_function < void() > | exception_handler_type |
An exception handler type. More... | |
Public Member Functions | |
sink (bool cross_thread) | |
Default constructor. More... | |
virtual | ~sink () |
Virtual destructor. More... | |
virtual bool | will_consume (attribute_value_set const &attributes)=0 |
The method returns true if no filter is set or the attribute values pass the filter. More... | |
virtual void | consume (record_view const &rec)=0 |
The method puts logging record to the sink. More... | |
virtual bool | try_consume (record_view const &rec) |
The method attempts to put logging record to the sink. More... | |
virtual void | flush ()=0 |
The method performs flushing of any internal buffers that may hold log records. More... | |
bool | is_cross_thread () const BOOST_NOEXCEPT |
The method indicates that the sink passes log records between different threads. More... | |
A base class for a logging sink frontend.
typedef boost::log::aux::light_function< void () > boost::sinks::sink::exception_handler_type |
An exception handler type.
|
inlineexplicit |
Default constructor.
|
inlinevirtual |
Virtual destructor.
|
pure virtual |
The method puts logging record to the sink.
rec | Logging record to consume |
Implemented in boost::sinks::asynchronous_sink< SinkBackendT, QueueingStrategyT >, boost::sinks::synchronous_sink< SinkBackendT >, and boost::sinks::unlocked_sink< SinkBackendT >.
|
pure virtual |
The method performs flushing of any internal buffers that may hold log records.
The method may take considerable time to complete and may block both the calling thread and threads attempting to put new records into the sink while this call is in progress.
Implemented in boost::sinks::asynchronous_sink< SinkBackendT, QueueingStrategyT >, boost::sinks::synchronous_sink< SinkBackendT >, and boost::sinks::unlocked_sink< SinkBackendT >.
|
inline |
The method indicates that the sink passes log records between different threads.
This information is needed by the logging core to detach log records from all thread-specific resources before passing it to the sink.
|
inlinevirtual |
The method attempts to put logging record 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.
rec | Logging record to consume |
true
, if the record was consumed, false
, if not. Reimplemented in boost::sinks::asynchronous_sink< SinkBackendT, QueueingStrategyT >, and boost::sinks::synchronous_sink< SinkBackendT >.
|
pure virtual |
The method returns true
if no filter is set or the attribute values pass the filter.
attributes | A set of attribute values of a logging record |
Implemented in boost::sinks::basic_sink_frontend.