Boost logo

Boost Users :

Subject: [Boost-users] Bost Logging
From: Mário Costa (mario.silva.costa_at_[hidden])
Date: 2017-10-04 17:16:56


I'm havving a bad time trying to figure out how to add and log custom
keywords using boost/log.

I havent been able to understand how exactly attribute keywords
(BOOST_LOG_ATTRIBUTE_KEYWORD) bind with logging e.g. using
BOOST_LOG_STREAM_WITH_PARAMS(logger, (??) (??)).

For instance, if I define a keyword line_number,

BOOST_LOG_ATTRIBUTE_KEYWORD(line_number, "LineNumber", unsigned int)

and add it to the formmater

logging::formatter formatter = expr::stream << "[" << line_number << "]"

How do I use


Tanking an exemple from the severities, I should use a keyword parameter
defining something like

BOOST_PARAMETER_KEYWORD(sometag, line_number)

then I should be able to use

BOOST_LOG_STREAM_WITH_PARAMS(logger, (line_number = 10))

But those things just don add up together.

I for sure missing the logics of the logging ...

Thanks for any help!


Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at