From b640c590878f3789a00e5c729d30e7807be034f6 Mon Sep 17 00:00:00 2001 From: gabime Date: Wed, 17 Jul 2019 14:41:07 +0300 Subject: [PATCH] try to prevent optimizer to remove null sink code altogether --- include/spdlog/sinks/null_sink.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/include/spdlog/sinks/null_sink.h b/include/spdlog/sinks/null_sink.h index 3e374893..16b33b82 100644 --- a/include/spdlog/sinks/null_sink.h +++ b/include/spdlog/sinks/null_sink.h @@ -22,10 +22,9 @@ protected: // prevent optimizer to remove this sink altogether (and do useful check while at it). if(msg.level == level::off) { - printf("Should never not be called if level is off!\n"); + printf("null_sink: should never not be called if level is off!\n"); + abort(); } - assert(msg.level != level::off); - } void flush_() override {} };