Is it possible to retrieve the logged message as a string from boost::log::record_view?

Romain Deterre

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?

Nathan Monteleone

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.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

boost::log::record_view assignment operator

From Dev

Is it possible to log a message from an Oozie Workflow without killing it

From Dev

Retrieve list of possible DateTime formats from string value

From Dev

Using xamarin to retrieve JSON message from URl and show in table view

From Dev

Using xamarin to retrieve JSON message from URl and show in table view

From Dev

How to log a message from a string variable in Unreal Engine?

From Dev

How to log a message from a string variable in Unreal Engine?

From Dev

Broadcast message from terminal to locally logged in user

From Dev

retrieve sql record from webservice and view on textbox

From Dev

Is it possible to retrieve data from collectionViewCell?

From Dev

Retrieve type from a String

From Dev

Retrieve tuple from string

From Dev

parsing from std::string into a boost::string_view using boost::spirit::x3

From Dev

parsing from std::string into a boost::string_view using boost::spirit::x3

From Dev

How to retrieve Logged user image from SharePoint server?

From Dev

How to retrieve user logged on by reading computer name from database?

From Dev

iOS Swift: retrieve an entry from the database for the user currently logged in

From Dev

Retrieve error message string in C in MEX file

From Dev

Retrieve error message string in C in MEX file

From Dev

Get log message from Assertions

From Dev

C++ boost regex: How to find all possible string constants from C/C++ code?

From Dev

How to retrieve username from a message in Quickblox?

From Dev

JMS message failed to retrieve from a queue

From Dev

Boost Client not able to receive message from server

From Dev

Retrieve a SubString from a String in the fastest possible way. Format from the end is fixed but not from the beginning, and Length is also not fixed

From Dev

Retrieve the values from a dictionary in a text (log) file

From Dev

retrieve numbers from a string with regex

From Dev

Regex to retrieve numbers from string

From Dev

Retrieve the date from a string path

Related Related

  1. 1

    boost::log::record_view assignment operator

  2. 2

    Is it possible to log a message from an Oozie Workflow without killing it

  3. 3

    Retrieve list of possible DateTime formats from string value

  4. 4

    Using xamarin to retrieve JSON message from URl and show in table view

  5. 5

    Using xamarin to retrieve JSON message from URl and show in table view

  6. 6

    How to log a message from a string variable in Unreal Engine?

  7. 7

    How to log a message from a string variable in Unreal Engine?

  8. 8

    Broadcast message from terminal to locally logged in user

  9. 9

    retrieve sql record from webservice and view on textbox

  10. 10

    Is it possible to retrieve data from collectionViewCell?

  11. 11

    Retrieve type from a String

  12. 12

    Retrieve tuple from string

  13. 13

    parsing from std::string into a boost::string_view using boost::spirit::x3

  14. 14

    parsing from std::string into a boost::string_view using boost::spirit::x3

  15. 15

    How to retrieve Logged user image from SharePoint server?

  16. 16

    How to retrieve user logged on by reading computer name from database?

  17. 17

    iOS Swift: retrieve an entry from the database for the user currently logged in

  18. 18

    Retrieve error message string in C in MEX file

  19. 19

    Retrieve error message string in C in MEX file

  20. 20

    Get log message from Assertions

  21. 21

    C++ boost regex: How to find all possible string constants from C/C++ code?

  22. 22

    How to retrieve username from a message in Quickblox?

  23. 23

    JMS message failed to retrieve from a queue

  24. 24

    Boost Client not able to receive message from server

  25. 25

    Retrieve a SubString from a String in the fastest possible way. Format from the end is fixed but not from the beginning, and Length is also not fixed

  26. 26

    Retrieve the values from a dictionary in a text (log) file

  27. 27

    retrieve numbers from a string with regex

  28. 28

    Regex to retrieve numbers from string

  29. 29

    Retrieve the date from a string path

HotTag

Archive