...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_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_formatted_sink_backend< CharT, concurrent_feeding > { public: // types typedef base_type::char_type char_type; // Character type. typedef base_type::string_type string_type; // String type to be used as a message text holder. // construct/copy/destruct basic_debug_output_backend(); ~basic_debug_output_backend(); // public member functions void consume(record_view const &, string_type 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.