I'm trying to create a somewhat log4c-alike Boost logger. Have decorated my log record with things like "File", "Function", "Line", etc. Have also created a custom filter, which gets all the attribute set via
bool Filter(const boost::log::attribute_value_set& set)
{
for (boost::log::attribute_value_set::const_iterator it=set.begin(); it != set.end(); ++it)
{
std::cout << "Name " << it->first << std::endl;
}
[...]
}
The base of the log is severity filter is created via
BOOST_LOG_GLOBAL_LOGGER_INIT( my_logger,boost::log::sources::severity_logger_mt < SeverityLevel > )
where SeverityLevel is a customer enum.
I'm creating the log records like:
BOOST_LOG_SEV(my_logger::get(),level) << boost::log::add_value("Mask", mask) << boost::log::add_value("Line", line) << boost::log::add_value("File", File) << boost::log::add_value("Function", Function) << l_line;
Where "line", "File", "Function" are the 'obvious' values from LINE, FILE and FUNCTION macros (meh I don't know how to escape double underscores, sorry).
To my surprise, the logrecord only contain the "global" record members like "Severity", "LineID", "TimeStamp", etc. but NOT my custom attributes created at log time (e.g. Line, File, Function, etc.). Obviously they are written to the log destination with my custom formatter without any problem.
I am obviously missing something pretty straightforward, mind me was googling this for half a day without any luck.
Can someone guide me what the heck I'm missing? Thanks,