Boost log severity_logger init_from_stream

拟墨画扇 提交于 2019-11-30 12:12:00

You are right. This is a known bug and fixed in the current development version.

Here is the bug report: https://svn.boost.org/trac/boost/ticket/8840

To make this answer less dependent on the link here is the way it was resolved within the report:

You need to register your severity attribute in the library before parsing the settings file. See here. The attribute may have to be registered both for formatter and filter parsers, if you want to filter records based on severity level.

OK, this is working but I had to add a stream input/extraction function and then I had to add the following two lines before loading the settings from the settings file:

logging::register_simple_formatter_factory<ESeverityLevel, char>("Severity");
logging::register_simple_filter_factory<ESeverityLevel, char>("Severity"); 
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!