Skip to content

Commit

Permalink
[easylog]if statement can be constexpr
Browse files Browse the repository at this point in the history
  • Loading branch information
scuzqy committed Nov 14, 2023
1 parent 51505c4 commit 23f7ecc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/ylt/easylog.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ inline void add_appender(std::function<void(std::string_view)> 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<Id>(); \
std::exit(EXIT_FAILURE); \
} \
Expand All @@ -240,7 +240,7 @@ inline void add_appender(std::function<void(std::string_view)> 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<Id>(); \
std::exit(EXIT_FAILURE); \
} \
Expand Down

0 comments on commit 23f7ecc

Please sign in to comment.