mirror of
https://github.com/Palakis/obs-websocket.git
synced 2024-08-30 18:12:16 +00:00
Request/Response: refactor logging code
This commit is contained in:
parent
54a16f4d2f
commit
acffacd67d
@ -116,9 +116,7 @@ void WSRequestHandler::processIncomingMessage(QString textMessage)
|
||||
}
|
||||
|
||||
if (Config::Current()->DebugEnabled)
|
||||
{
|
||||
blog(LOG_DEBUG, "Request >> '%s'", msg);
|
||||
}
|
||||
|
||||
if (!hasField("request-type") ||
|
||||
!hasField("message-id"))
|
||||
@ -177,14 +175,11 @@ void WSRequestHandler::SendErrorResponse(const char* errorMessage)
|
||||
void WSRequestHandler::SendResponse(obs_data_t* response)
|
||||
{
|
||||
const char *json = obs_data_get_json(response);
|
||||
obs_data_release(response);
|
||||
|
||||
if (Config::Current()->DebugEnabled)
|
||||
{
|
||||
blog(LOG_DEBUG, "Response << '%s'", json);
|
||||
}
|
||||
|
||||
_client->sendTextMessage(json);
|
||||
if (Config::Current()->DebugEnabled)
|
||||
blog(LOG_DEBUG, "Response << '%s'", json);
|
||||
|
||||
obs_data_release(response);
|
||||
}
|
||||
|
||||
bool WSRequestHandler::hasField(const char* name)
|
||||
@ -1541,4 +1536,4 @@ void WSRequestHandler::HandleSetBrowserSourceProperties(WSRequestHandler* req)
|
||||
req->SendErrorResponse("specified scene item doesn't exist");
|
||||
}
|
||||
obs_source_release(scene);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user