提升日志窗口调试器输出格式

时间:2016-10-21 14:35:23

标签: c++ boost boost-log

Boost docs中所述,Boost.log可以将消息输出到Visual Studio / DBGView中可见的Windows调试输出

Boost示例显示了如何创建接收器并将其添加到日志记录中:

typedef sinks::synchronous_sink< sinks::debug_output_backend > sink_t;
void init_logging()
{
    boost::shared_ptr< logging::core > core = logging::core::get();
    // Create the sink. The backend requires synchronization in the frontend.
    boost::shared_ptr< sink_t > sink(new sink_t());
    // Set the special filter to the frontend
    // in order to skip the sink when no debugger is available
    sink->set_filter(expr::is_debugger_present());
    core->add_sink(sink);
}

但是如何设置邮件格式?对于控制台和文件输出,它看起来很简单,但不适用于Windows调试输出

0 个答案:

没有答案