diff --git a/include/msg/detail/indexed_handler_common.hpp b/include/msg/detail/indexed_handler_common.hpp index 334be319..5b0eb835 100644 --- a/include/msg/detail/indexed_handler_common.hpp +++ b/include/msg/detail/indexed_handler_common.hpp @@ -56,7 +56,9 @@ struct indexed_handler : handler_interface { std::logical_or{}, false, callback_candidates); if (not handled) { - CIB_ERROR("None of the registered callbacks claimed this message."); + CIB_ERROR( + "None of the registered callbacks ({}) claimed this message.", + sc::uint_>); } return handled; } diff --git a/include/msg/handler.hpp b/include/msg/handler.hpp index 5e220329..31029b63 100644 --- a/include/msg/handler.hpp +++ b/include/msg/handler.hpp @@ -2,6 +2,7 @@ #include #include +#include #include @@ -27,7 +28,9 @@ struct handler : handler_interface { }, callbacks); if (!found_valid_callback) { - CIB_ERROR("None of the registered callbacks claimed this message:"); + CIB_ERROR( + "None of the registered callbacks ({}) claimed this message:", + sc::uint_>); stdx::for_each([&](auto &callback) { callback.log_mismatch(msg); }, callbacks); } diff --git a/test/msg/handler.cpp b/test/msg/handler.cpp index 95e5533b..9becdc74 100644 --- a/test/msg/handler.cpp +++ b/test/msg/handler.cpp @@ -87,7 +87,7 @@ TEST_CASE("log mismatch when no match", "[handler]") { CHECK(not handler.handle(msg)); CAPTURE(log_buffer); CHECK(log_buffer.find( - "None of the registered callbacks claimed this message") != + "None of the registered callbacks (0) claimed this message") != std::string::npos); } diff --git a/test/msg/handler_builder.cpp b/test/msg/handler_builder.cpp index c8731c5e..df37943a 100644 --- a/test/msg/handler_builder.cpp +++ b/test/msg/handler_builder.cpp @@ -111,7 +111,7 @@ TEST_CASE("match output failure", "[handler_builder]") { CAPTURE(log_buffer); CHECK(log_buffer.find( - "None of the registered callbacks claimed this message") != + "None of the registered callbacks (1) claimed this message") != std::string::npos); CHECK(log_buffer.find("cb") != std::string::npos); CHECK(log_buffer.find("id (0x81) == 0x80") != std::string::npos); diff --git a/test/msg/indexed_builder.cpp b/test/msg/indexed_builder.cpp index 49f4f87c..9b21a4ac 100644 --- a/test/msg/indexed_builder.cpp +++ b/test/msg/indexed_builder.cpp @@ -113,8 +113,9 @@ TEST_CASE("match output failure", "[indexed_builder]") { CHECK(not cib::service->handle( test_msg_t{"test_id_field"_field = 0x81})); + CAPTURE(log_buffer); CHECK(log_buffer.find( - "None of the registered callbacks claimed this message") != + "None of the registered callbacks (1) claimed this message") != std::string::npos); }