|
Boost : |
From: Martin Bonner (martin.bonner_at_[hidden])
Date: 2005-12-15 09:14:37
----Original Message----
From: Richard Glanmark [mailto:Richard.Glanmark_at_[hidden]]
Sent: 15 December 2005 08:33
To: boost_at_[hidden]
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_at_[hidden] Pi Technology, Milton Hall, Ely Road, Milton, Cambridge, CB4 6WZ, ENGLAND Tel: +44 (0)1223 441434
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk