I'm using Boost v1.54 and I would like to simply change the default sink format of logging::core but haven't found a way to do so. In the Log Record Formatting documentation they only show how to change the format for custom sinks e.g. log files and not the default one? Is there a way to globally set the default format in Boost Log?
This is what they do:
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
);
}
This is what I would like:
void init()
{
logging::core::get()->set_default_format("[%TimeStamp%]: %Message%");
logging::core::get()->set_filter
(
logging::trivial::severity >= logging::trivial::info
);
}