Questions about extending boost::log sink backend based on app_luncher example
Hi,I am extending the boost::log backend sink to show log record into GUI ListBox control, which is gui_logger. I modify based on the app_luncher example which extends backend sink of :basic_formatted_sink_backend. Below are the questions that I have for now: 1) when modifying the consume function, I don't know how to get the message body. void consume(logging::record_view const& rec, string_type const& command_line); I using TRACE of visualstudio 2015 to first log the message out into vs2015 console. But I don't know how the get the message from record_view? 2) When I TRACE(command_line.c_str()) of consume function, I logged every record out into vs2015 console. I need to set a filter to only output some of the log. How to set filters with gui_logger? I notice there is sink->set_filter function, but I don't know how to set in my situation.In my scenario, I setup a src::severity_channel_logger (db_logger) with keywords::channel = "dblog", which output to db.log file. I want to use gui_logger to show the latest 200 records on the ListBox. gui_logger should use the same filter with db_logger. gui_logger log the latest 200 records into gui ListBox. db_logger log all the records into text file. So I need to set the same filter with db_logger. 3) I read settings from the ini file for db_logger. I want also to read setting from ini file for gui_logger. How to do it?
participants (1)
-
Bruce