From 99f93c4bdd0baa1e0cbc66a5c2b0915e1cdf7ccb Mon Sep 17 00:00:00 2001 From: tt2468 Date: Sat, 2 Jul 2022 10:53:46 -0700 Subject: [PATCH] websocketserver: Log disconnect code and reason on disconnects No clue why I wasn't doing this before. --- src/websocketserver/WebSocketServer.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/websocketserver/WebSocketServer.cpp b/src/websocketserver/WebSocketServer.cpp index 6b5d89b98..e4eaff5f0 100644 --- a/src/websocketserver/WebSocketServer.cpp +++ b/src/websocketserver/WebSocketServer.cpp @@ -344,7 +344,8 @@ void WebSocketServer::onClose(websocketpp::connection_hdl hdl) emit ClientDisconnected(state, conn->get_local_close_code()); // Log disconnection - blog(LOG_INFO, "[WebSocketServer::onClose] WebSocket client %s has disconnected", remoteAddress.c_str()); + blog(LOG_INFO, "[WebSocketServer::onClose] WebSocket client `%s` has disconnected with code `%d` and reason: %s", + remoteAddress.c_str(), conn->get_local_close_code(), conn->get_local_close_reason().c_str()); // Get config for tray notification auto conf = GetConfig();