From: Darren Cook (darren_at_[hidden])
Date: 2005-04-26 01:05:59
>> But it is still taking up space; not to mention CPU usage doing a
>> run-time check to see if a log is enabled.
> Depending on how the check is performed, the overhead is virtually
But still there :-).
>> BOOST_LOG(app,"testing " << i << '-' << j << '-' << k);
> Well, you can count my vote against this method. For you, the entire
> point of doing it this way is so that the logging can be compiled out -
It is also slightly shorter. It seems just as natural to me.
> Having worked on quite a few large-scale commercial software ...
> ...there is almost never a reason to compile out tracing code.
Yes, I usually leave in log lines on my large-scale commercial projects
But I want to have both: I want some log statements I can insert while
debugging time-critical code and disable at compile time, and others
that are always there but that I can choose to switch on and off at
run-time. And I want both in the same project.
Perhaps then BOOST_LOG_DBG() is a better name for the one that can be
compiled out. Or BOOST_LOGD().
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk