
26 Apr
2005
26 Apr
'05
6:12 a.m.
John Torjo wrote:
Hi. If I understand right the code, even if log is disabled, I do pay for constructing log messages. Am I right? If so why do you force this?
No, you donot pay.
BOOST_LOG(app) << "testing " << i << '-' << j << '-' << k;
Is the equivalent of:
if ( is_log_enabled(app) ) app_log() << "testing" << i ...;
And you need to 1. #include <something> 2. Compile the 'if', and the operators<<, and what not. Consider that I want to add logging to a header-only library, say some BGL. algorithm I don't want all users of BGL to depend on a logging library. They just should be able to #define BOOST_GRAPH_SOME_ALGORITH_LOGGING and get logging for the specified algorithm -- only if needed. - Volodya