boost::log::sinks::basic_debug_output_backend — An implementation of a logging sink backend that outputs to the debugger.
// In header: <boost/log/sinks/debug_output_backend.hpp> template<typename CharT> class basic_debug_output_backend : public basic_formatting_sink_backend< CharT > { public: // types typedef base_type::char_type char_type; // Character type. typedef base_type::target_string_type target_string_type; // String type to be used as a message text holder. typedef base_type::values_view_type values_view_type; // Attribute values view type. typedef base_type::record_type record_type; // Log record type. // construct/copy/destruct basic_debug_output_backend(); ~basic_debug_output_backend(); // public member functions debugger_presence_filter get_debugger_presence_filter() const; };
The sink uses Windows API in order to write log records as debug messages, if the application process is run under debugger. The sink backend also provides a specific filter that allows to check whether the debugger is available and thus elide unnecessary formatting.