diff --git a/include/ylt/easylog.hpp b/include/ylt/easylog.hpp index 348e9cbed..42df82b9d 100644 --- a/include/ylt/easylog.hpp +++ b/include/ylt/easylog.hpp @@ -213,7 +213,7 @@ inline void add_appender(std::function fn) { easylog::record_t(std::chrono::system_clock::now(), severity, \ GET_STRING(__FILE__, __LINE__)) \ .sprintf(fmt, __VA_ARGS__); \ - if (severity == easylog::Severity::CRITICAL) { \ + if constexpr (severity == easylog::Severity::CRITICAL) { \ easylog::flush(); \ std::exit(EXIT_FAILURE); \ } \ @@ -240,7 +240,7 @@ inline void add_appender(std::function fn) { easylog::record_t(std::chrono::system_clock::now(), severity, \ GET_STRING(__FILE__, __LINE__)) \ .format(prefix::format(format_str, __VA_ARGS__)); \ - if (severity == easylog::Severity::CRITICAL) { \ + if constexpr (severity == easylog::Severity::CRITICAL) { \ easylog::flush(); \ std::exit(EXIT_FAILURE); \ } \