Skip to content

Commit

Permalink
websocketserver: Log disconnect code and reason on disconnects
Browse files Browse the repository at this point in the history
No clue why I wasn't doing this before.
  • Loading branch information
tt2468 committed Jul 2, 2022
1 parent 6af3af6 commit 99f93c4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/websocketserver/WebSocketServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 99f93c4

Please sign in to comment.