
----Original Message---- From: Richard Glanmark [mailto:Richard.Glanmark@neonet.biz] Sent: 15 December 2005 08:33 To: boost@lists.boost.org Subject: Re: [boost] [Review] Boost.Logging: formal review
Some thoughts and ideas about some of the topics that has been discussed regarding the proposed Boost.Logging library.
1. Enabled/disabled logger, logging macros and efficiency
The logging macro BOOST_LOG should accept two arguments instead of one. The logger and the log message. The syntax
(1) BOOST_LOG(some_log) << "my message " << foo() << bar();
should be replaced with
(2) BOOST_LOG(some_log, "my message " << foo() << bar());
and the macro being defined something like this
(3) #define BOOST_LOG(logger, msg) \ if(logger.isEnabled()) { /* code that logs msg */ ... }
The current definition is (I believe) #define BOOST_LOG(logger) \ if(!logger.isEnabled()) {} else logger Which achieves the same ends. In particular, foo() is not called unless logging occurs. -- Martin Bonner Martin.Bonner@Pitechnology.com Pi Technology, Milton Hall, Ely Road, Milton, Cambridge, CB4 6WZ, ENGLAND Tel: +44 (0)1223 441434