Commit 0cef8f3d authored by gabime's avatar gabime

try to prevent optimizer to remove null sink code altogether

parent fbde18fc
...@@ -20,7 +20,7 @@ protected: ...@@ -20,7 +20,7 @@ protected:
void sink_it_(const details::log_msg &msg) override void sink_it_(const details::log_msg &msg) override
{ {
// prevent optimizer to remove this sink altogether (and do useful check while at it). // prevent optimizer to remove this sink altogether (and do useful check while at it).
if(msg.level == level::off) if(msg.level == level::off || this->level() == level::off)
{ {
printf("null_sink: should never be called if level is off!\n"); printf("null_sink: should never be called if level is off!\n");
abort(); abort();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment