#define LOG(level) \
(level > Log::CurrentLev el() ? NullStream(): Log().Get(level ))
struct NullStream:std: :ostream {
public:
NullStream():st d::ios(0), std::ostream(0) {}
};
Log().Get() returns a ostringstream.
The following statement statement gives the below compiler error:
LOG(3) << "logging" << endl;
error: operands to ?: have different types ‘NullStream’ and ‘std::basic_ost ringstream<char , std::char_trait s<char>, std::allocator< char> >’
How can I rewrite the Macro LOG?
Thanks
Naveen
(level > Log::CurrentLev el() ? NullStream(): Log().Get(level ))
struct NullStream:std: :ostream {
public:
NullStream():st d::ios(0), std::ostream(0) {}
};
Log().Get() returns a ostringstream.
The following statement statement gives the below compiler error:
LOG(3) << "logging" << endl;
error: operands to ?: have different types ‘NullStream’ and ‘std::basic_ost ringstream<char , std::char_trait s<char>, std::allocator< char> >’
How can I rewrite the Macro LOG?
Thanks
Naveen
Comment