From ccb1cbb7e42bc7f2067f4aa9f66a5ff9c90c94ac Mon Sep 17 00:00:00 2001 From: Ben Deane Date: Wed, 4 Dec 2024 13:46:49 -0700 Subject: [PATCH] :art: Improve CIB_FATAL Problem: - `CIB_FATAL` formats the string it passes to `log`, but passes the bare arguments to `stdx::panic`. Solution: - Pass the formatted string to `stdx::panic`. Note: - There is a small improvement here to `to_message` also. --- include/log/catalog/mipi_encoder.hpp | 20 +++++------------ include/log/log.hpp | 14 +++++++++--- test/log/log.cpp | 33 +++++++++++++++++++++++++++- 3 files changed, 48 insertions(+), 19 deletions(-) diff --git a/include/log/catalog/mipi_encoder.hpp b/include/log/catalog/mipi_encoder.hpp index 4190c592..ffea4d82 100644 --- a/include/log/catalog/mipi_encoder.hpp +++ b/include/log/catalog/mipi_encoder.hpp @@ -18,24 +18,14 @@ namespace logging::mipi { namespace detail { -template +template constexpr auto to_message() { constexpr auto s = S::value; using char_t = typename std::remove_cv_t::value_type; - return [&]