diff --git a/include/ylt/easylog.hpp b/include/ylt/easylog.hpp index c564bb2ab..adb3d39ac 100644 --- a/include/ylt/easylog.hpp +++ b/include/ylt/easylog.hpp @@ -231,7 +231,7 @@ inline void add_appender(std::function fn) { #if __has_include() || __has_include() -#define ELOGFMT_IMPL0(severity, Id, prefix, format_str, ...) \ +#define ELOGFMT_IMPL0(severity, Id, prefix, ...) \ if (!easylog::logger::instance().check_severity(severity)) { \ ; \ } \ @@ -239,7 +239,7 @@ inline void add_appender(std::function fn) { easylog::logger::instance() += \ easylog::record_t(std::chrono::system_clock::now(), severity, \ GET_STRING(__FILE__, __LINE__)) \ - .format(prefix::format(format_str, __VA_ARGS__)); \ + .format(prefix::format(__VA_ARGS__)); \ if constexpr (severity == easylog::Severity::CRITICAL) { \ easylog::flush(); \ std::exit(EXIT_FAILURE); \ diff --git a/src/easylog/tests/test_easylog.cpp b/src/easylog/tests/test_easylog.cpp index fb41261b9..b8718e9df 100644 --- a/src/easylog/tests/test_easylog.cpp +++ b/src/easylog/tests/test_easylog.cpp @@ -81,6 +81,7 @@ TEST_CASE("test basic") { ELOG_INFO << buf << ", " << str << ", " << sv << ", " << id; #if __has_include() || (__has_include() && !defined(__APPLE__)) + ELOGFMT(INFO, "Hello"); ELOGFMT(INFO, "{} {}", 20, 42); ELOGFMT(INFO, "it is a long string test {} {}", 42, "fmt"); #endif