The documentation of record_view
states that it encapsulates the log message string.
I'd like to retrieve it in the context of the consume
function of a custom basic_string_backend
subclass.
Is it possible, or do I have to derive from basic_formatted_sink_backend
?
You can get it like this:
void consume(boost::logger::record_view const& rec)
{
std::string myString = *rec[boost::logger::expressions::smessage];
// etc...
}
Include boost/logger/expressions.h to get boost::logger::expressions::smessage.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With