|
Boost : |
From: Steven Watanabe (steven_at_[hidden])
Date: 2007-04-02 13:01:20
AMDG
JD <jean.daniel.michaud <at> gmail.com> writes:
> Caleb Epstein:
> * Messages which won't be logged shouldn't even go through the
> formatting step. I'm pretty sure this cannot be done in a single call
> w/o macros though.
>
I don't see why this wouldn't work:
std::string x, y;
//...
logger << lazy(lambda::var(x) + ":" + y, _level = 2);
If you need a compile-time switch:
logger << lazy(lambda::var(x) + ":" + y, _level = mpl::int_<2>());
if you want to shut off all logging:
struct logger {
template<class T>
logger& operator<<(const T&) {}
};
In Christ,
Steven Watanabe
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk