diff options
Diffstat (limited to 'source')
| -rw-r--r-- | source/lib/include/wanda/message.hpp | 10 | ||||
| -rw-r--r-- | source/lib/src/control_interface.cpp | 2 |
2 files changed, 11 insertions, 1 deletions
diff --git a/source/lib/include/wanda/message.hpp b/source/lib/include/wanda/message.hpp index 866408f..0f3034c 100644 --- a/source/lib/include/wanda/message.hpp +++ b/source/lib/include/wanda/message.hpp @@ -11,6 +11,7 @@ #include <istream> #include <optional> #include <string> +#include <fmt/core.h> namespace wanda { @@ -80,4 +81,13 @@ namespace wanda } // namespace wanda +template<> +struct fmt::formatter<wanda::message> : fmt::formatter<std::string> +{ + auto format(wanda::message const & message, format_context & context) const + { + return formatter<string_view>::format(static_cast<std::string>(message), context); + } +}; + #endif
\ No newline at end of file diff --git a/source/lib/src/control_interface.cpp b/source/lib/src/control_interface.cpp index 5f4cf26..68005f9 100644 --- a/source/lib/src/control_interface.cpp +++ b/source/lib/src/control_interface.cpp @@ -75,7 +75,7 @@ namespace wanda m_acceptor.async_accept(m_socket, [that = shared_from_this(), this](auto const & error) { if (error && error != asio::error::operation_aborted) { - get_logger()->error("failed to accept connection because '{}'", error); + get_logger()->error("failed to accept connection because '{}'", error.message()); } else { |
