From d7f3bc8b9ffc7f04daf185691fbf952ac4f851df Mon Sep 17 00:00:00 2001 From: Tixx <83774803+WiserTixx@users.noreply.github.com> Date: Mon, 9 Dec 2024 23:47:10 +0100 Subject: [PATCH] Debug log responses from auth and backend --- src/THeartbeatThread.cpp | 6 +++++- src/TNetwork.cpp | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/THeartbeatThread.cpp b/src/THeartbeatThread.cpp index 1f8f9d3..ac0d745 100644 --- a/src/THeartbeatThread.cpp +++ b/src/THeartbeatThread.cpp @@ -67,11 +67,15 @@ void THeartbeatThread::operator()() { bool Ok = false; for (const auto& Url : Application::GetBackendUrlsInOrder()) { T = Http::POST(Url, 443, Target, Body, "application/json", &ResponseCode, { { "api-v", "2" } }); + + if (!Application::Settings.getAsBool(Settings::Key::General_Private)) { + beammp_debug("Backend response was: `" + T + "`"); + } + Doc.Parse(T.data(), T.size()); if (Doc.HasParseError() || !Doc.IsObject()) { if (!Application::Settings.getAsBool(Settings::Key::General_Private)) { beammp_trace("Backend response failed to parse as valid json"); - beammp_trace("Response was: `" + T + "`"); } } else if (ResponseCode != 200) { beammp_errorf("Response code from the heartbeat: {}", ResponseCode); diff --git a/src/TNetwork.cpp b/src/TNetwork.cpp index ee3c013..51f4cd0 100644 --- a/src/TNetwork.cpp +++ b/src/TNetwork.cpp @@ -354,6 +354,8 @@ std::shared_ptr TNetwork::Authentication(TConnection&& RawConnection) { return nullptr; } + beammp_debug("Response from authentication backend: " + AuthResStr); + try { nlohmann::json AuthRes = nlohmann::json::parse(AuthResStr);