|
Boost Users : |
Subject: [Boost-users] [log] switching from n loggers to 1
From: Eric Prud'hommeaux (eric_at_[hidden])
Date: 2013-11-27 07:17:57
I'm updating an old library which sets up eight separate loggers with
different channel labels:
BOOST_LOG_INLINE_GLOBAL_LOGGER_DEFAULT(DefaultLog, SWObjectsLogger);
BOOST_LOG_INLINE_GLOBAL_LOGGER_CTOR_ARGS(RewriteLog, SWObjectsLogger, (channel = "Rewrite"));
...
BOOST_LOG_SEV(L::RewriteLog::get(), L::info) << "foo->bar\n";
I'd like to update to 1.54 (or 1.55) and before I `perl -i` the heck out
of it, I'm wondering what are the tradeoffs around using a single logger:
BOOST_LOG_INLINE_GLOBAL_LOGGER_DEFAULT(TheLogger, boost::log::sources::severity_channel_logger< severity_level >)
...
BOOST_LOG_CHANNEL_SEV(L::TheLogger::get(), L:Rewrite, L::info) << "foo->bar";
I can guess that many loggers gives me more (future) versatility to
log Rewrite stuff to a different stream and that these eight loggers
come with some memory footprint. Is that about right?
(Also, why does adding a template parameter for the channel
BOOST_LOG_INLINE_GLOBAL_LOGGER_DEFAULT(TheLogger, boost::log::sources::severity_channel_logger< severity_level >)
barf with macro errors?
expressions_channel_severity_filter.cpp:306:127: error: macro "BOOST_LOG_INLINE_GLOBAL_LOGGER_DEFAULT" passed 3 arguments, but takes just 2
expressions_channel_severity_filter.cpp:306:1: error: âBOOST_LOG_INLINE_GLOBAL_LOGGER_DEFAULTâ does not name a type?
)
-- -ericP office: +1.617.599.3509 mobile: +33.6.80.80.35.59 (eric_at_[hidden]) Feel free to forward this message to any list for any purpose other than email address distribution. There are subtle nuances encoded in font variation and clever layout which can only be seen by printing this message on high-clay paper.
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net