Skip to content

Commit a3b3cf9

Browse files
committed
Improve disconnect reason logging
1 parent ca3bbf5 commit a3b3cf9

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

plugins/twitch/event-sub.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -426,8 +426,11 @@ void EventSub::HandleRevocation(obs_data_t *data)
426426
void EventSub::OnClose(connection_hdl hdl)
427427
{
428428
EventSubWSClient::connection_ptr con = _client.get_con_from_hdl(hdl);
429-
auto msg = con->get_ec().message();
430-
blog(LOG_INFO, "Twitch EventSub connection closed: %s", msg.c_str());
429+
const auto msg = con->get_ec().message();
430+
const auto reason = con->get_remote_close_reason();
431+
const auto code = con->get_remote_close_code();
432+
blog(LOG_INFO, "Twitch EventSub connection closed: %s / %s (%d)",
433+
msg.c_str(), reason.c_str(), code);
431434
ClearActiveSubscriptions();
432435
_connected = false;
433436
}

0 commit comments

Comments
 (0)