diff --git a/include/ylt/easylog/record.hpp b/include/ylt/easylog/record.hpp index 68ea9651f..2dcd224f7 100644 --- a/include/ylt/easylog/record.hpp +++ b/include/ylt/easylog/record.hpp @@ -117,7 +117,11 @@ class record_t { const auto end = jkj::dragonbox::to_chars(data, temp); ss_.append(temp, std::distance(temp, end)); } + else if constexpr (std::is_same_v) { + data ? ss_.append("true") : ss_.append("false"); + } else if constexpr (std::is_same_v) { + data ? ss_.append("true") : ss_.append("false"); ss_.push_back(data); } else if constexpr (std::is_enum_v) { diff --git a/src/easylog/tests/test_easylog.cpp b/src/easylog/tests/test_easylog.cpp index 16821f46b..8c14482a8 100644 --- a/src/easylog/tests/test_easylog.cpp +++ b/src/easylog/tests/test_easylog.cpp @@ -41,6 +41,7 @@ TEST_CASE("test basic") { std::unique_ptr ptr(new int(42)); ELOG_INFO << ptr.get(); ELOG_INFO << 42 << " " << 4.5 << 'a' << Severity::DEBUG; + ELOG_INFO << false << ", " << true; ELOGV(INFO, "test"); ELOGV(INFO, "it is a long string test %d %s", 2, "ok");