From a3b3cf9818e53061d10916ad37e36cb9e94e8b14 Mon Sep 17 00:00:00 2001 From: WarmUpTill <19472752+WarmUpTill@users.noreply.github.com> Date: Fri, 3 Oct 2025 12:35:01 +0200 Subject: [PATCH] Improve disconnect reason logging --- plugins/twitch/event-sub.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/plugins/twitch/event-sub.cpp b/plugins/twitch/event-sub.cpp index 6f56d182..5233abe4 100644 --- a/plugins/twitch/event-sub.cpp +++ b/plugins/twitch/event-sub.cpp @@ -426,8 +426,11 @@ void EventSub::HandleRevocation(obs_data_t *data) void EventSub::OnClose(connection_hdl hdl) { EventSubWSClient::connection_ptr con = _client.get_con_from_hdl(hdl); - auto msg = con->get_ec().message(); - blog(LOG_INFO, "Twitch EventSub connection closed: %s", msg.c_str()); + const auto msg = con->get_ec().message(); + const auto reason = con->get_remote_close_reason(); + const auto code = con->get_remote_close_code(); + blog(LOG_INFO, "Twitch EventSub connection closed: %s / %s (%d)", + msg.c_str(), reason.c_str(), code); ClearActiveSubscriptions(); _connected = false; }