Skip to content

Commit

Permalink
Debug log responses from auth and backend
Browse files Browse the repository at this point in the history
  • Loading branch information
WiserTixx committed Dec 23, 2024
1 parent 687a988 commit d7f3bc8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/THeartbeatThread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 2 additions & 0 deletions src/TNetwork.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,8 @@ std::shared_ptr<TClient> TNetwork::Authentication(TConnection&& RawConnection) {
return nullptr;
}

beammp_debug("Response from authentication backend: " + AuthResStr);

try {
nlohmann::json AuthRes = nlohmann::json::parse(AuthResStr);

Expand Down

0 comments on commit d7f3bc8

Please sign in to comment.