I am creating new sink like in this example:
void init()
{
logging::add_file_log
(
keywords::file_name = "sample_%N.log",
keywords::rotation_size = 10 * 1024 * 1024,
keywords::time_based_rotation = sinks::file::rotation_at_time_point(0, 0, 0),
keywords::format = "[%TimeStamp%]: %Message%"
);
logging::core::get()->set_filter
(
logging::trivial::severity >= logging::trivial::info
);
}
I have implemented my own filter object:
struct MyFilter {
...
bool operator()(const boost::log::attribute_value_set& attrs) const noexcept
{
bool result = ....
// Do my filtering
return result;
}
...
};
How do I pass it as sink initialization parameter? i.e. I want to add following parameter:
keywords::filter = SOMETHING(MyFilter())
But I so far could not figure out what that "SOMETHING" should be. Can't find any examples. Can you please help me?