mirror of
https://github.com/gabime/spdlog.git
synced 2024-11-15 16:35:45 +08:00
try to prevent optimizer to remove null sink code altogether
This commit is contained in:
parent
0cef8f3d26
commit
dca1d1e0d1
@ -20,9 +20,9 @@ protected:
|
||||
void sink_it_(const details::log_msg &msg) override
|
||||
{
|
||||
// prevent optimizer to remove this sink altogether (and do useful check while at it).
|
||||
if(msg.level == level::off || this->level() == level::off)
|
||||
if(this->level() == level::off)
|
||||
{
|
||||
printf("null_sink: should never be called if level is off!\n");
|
||||
printf("null_sink: should never be called if its level is off!\n");
|
||||
abort();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user