diff options
| author | Léo Lam <leo@leolam.fr> | 2020-10-23 19:59:22 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-10-23 19:59:22 +0200 |
| commit | ce6eda7c717c1dad7d79b91ec421c196ac969357 (patch) | |
| tree | 873d58f4d200391135106b5e459b8d45cf47332c /Source/Core/InputCommon/ControllerInterface/DualShockUDPClient | |
| parent | 87e4a0785addc5c0e4eb04cb7cf8d93c551d34fc (diff) | |
| parent | a5e1415e74ce5b6b2a339256aa3e97748a3a2484 (diff) | |
Merge pull request #9184 from lioncash/inputlog
InputCommon: Migrate logging over to fmt
Diffstat (limited to 'Source/Core/InputCommon/ControllerInterface/DualShockUDPClient')
| -rw-r--r-- | Source/Core/InputCommon/ControllerInterface/DualShockUDPClient/DualShockUDPClient.cpp | 14 | ||||
| -rw-r--r-- | Source/Core/InputCommon/ControllerInterface/DualShockUDPClient/DualShockUDPProto.h | 11 |
2 files changed, 14 insertions, 11 deletions
diff --git a/Source/Core/InputCommon/ControllerInterface/DualShockUDPClient/DualShockUDPClient.cpp b/Source/Core/InputCommon/ControllerInterface/DualShockUDPClient/DualShockUDPClient.cpp index 371db4219c..200b904b17 100644 --- a/Source/Core/InputCommon/ControllerInterface/DualShockUDPClient/DualShockUDPClient.cpp +++ b/Source/Core/InputCommon/ControllerInterface/DualShockUDPClient/DualShockUDPClient.cpp @@ -215,7 +215,7 @@ static sf::Socket::Status ReceiveWithTimeout(sf::UdpSocket& socket, void* data, static void HotplugThreadFunc() { Common::SetCurrentThreadName("DualShockUDPClient Hotplug Thread"); - INFO_LOG(SERIALINTERFACE, "DualShockUDPClient hotplug thread started"); + INFO_LOG_FMT(SERIALINTERFACE, "DualShockUDPClient hotplug thread started"); while (s_hotplug_thread_running.IsSet()) { @@ -235,7 +235,7 @@ static void HotplugThreadFunc() if (server.m_socket.send(&list_ports, sizeof list_ports, server.m_address, server.m_port) != sf::Socket::Status::Done) { - ERROR_LOG(SERIALINTERFACE, "DualShockUDPClient HotplugThreadFunc send failed"); + ERROR_LOG_FMT(SERIALINTERFACE, "DualShockUDPClient HotplugThreadFunc send failed"); } } } @@ -269,7 +269,7 @@ static void HotplugThreadFunc() } } } - INFO_LOG(SERIALINTERFACE, "DualShockUDPClient hotplug thread stopped"); + INFO_LOG_FMT(SERIALINTERFACE, "DualShockUDPClient hotplug thread stopped"); } static void StartHotplugThread() @@ -302,7 +302,7 @@ static void StopHotplugThread() static void Restart() { - INFO_LOG(SERIALINTERFACE, "DualShockUDPClient Restart"); + INFO_LOG_FMT(SERIALINTERFACE, "DualShockUDPClient Restart"); StopHotplugThread(); @@ -384,7 +384,7 @@ void Init() void PopulateDevices() { - INFO_LOG(SERIALINTERFACE, "DualShockUDPClient PopulateDevices"); + INFO_LOG_FMT(SERIALINTERFACE, "DualShockUDPClient PopulateDevices"); for (auto& server : s_servers) { @@ -496,7 +496,9 @@ void Device::UpdateInput() msg.Finish(); if (m_socket.send(&data_req, sizeof(data_req), m_server_address, m_server_port) != sf::Socket::Status::Done) - ERROR_LOG(SERIALINTERFACE, "DualShockUDPClient UpdateInput send failed"); + { + ERROR_LOG_FMT(SERIALINTERFACE, "DualShockUDPClient UpdateInput send failed"); + } } // Receive and handle controller data diff --git a/Source/Core/InputCommon/ControllerInterface/DualShockUDPClient/DualShockUDPProto.h b/Source/Core/InputCommon/ControllerInterface/DualShockUDPClient/DualShockUDPProto.h index 97b453a68a..582b483555 100644 --- a/Source/Core/InputCommon/ControllerInterface/DualShockUDPClient/DualShockUDPProto.h +++ b/Source/Core/InputCommon/ControllerInterface/DualShockUDPClient/DualShockUDPProto.h @@ -242,15 +242,16 @@ struct Message template <class ToMsgType> std::optional<ToMsgType> CheckAndCastTo() { - u32 crc32_in_header = m_message.header.crc32; + const u32 crc32_in_header = m_message.header.crc32; // zero out the crc32 in the packet once we got it since that's whats needed for calculation m_message.header.crc32 = 0; - u32 crc32_calculated = CRC32(&m_message, sizeof(ToMsgType)); + const u32 crc32_calculated = CRC32(&m_message, sizeof(ToMsgType)); if (crc32_in_header != crc32_calculated) { - NOTICE_LOG(SERIALINTERFACE, - "DualShockUDPClient Received message with bad CRC in header: got %u, expected %u", - crc32_in_header, crc32_calculated); + NOTICE_LOG_FMT( + SERIALINTERFACE, + "DualShockUDPClient Received message with bad CRC in header: got {:08x}, expected {:08x}", + crc32_in_header, crc32_calculated); return std::nullopt; } if (m_message.header.protocol_version > CEMUHOOK_PROTOCOL_VERSION) |
