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)
|
if (Config::Current()->DebugEnabled)
|
||||||
{
|
|
||||||
blog(LOG_DEBUG, "Request >> '%s'", msg);
|
blog(LOG_DEBUG, "Request >> '%s'", msg);
|
||||||
}
|
|
||||||
|
|
||||||
if (!hasField("request-type") ||
|
if (!hasField("request-type") ||
|
||||||
!hasField("message-id"))
|
!hasField("message-id"))
|
||||||
@ -177,14 +175,11 @@ void WSRequestHandler::SendErrorResponse(const char* errorMessage)
|
|||||||
void WSRequestHandler::SendResponse(obs_data_t* response)
|
void WSRequestHandler::SendResponse(obs_data_t* response)
|
||||||
{
|
{
|
||||||
const char *json = obs_data_get_json(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);
|
_client->sendTextMessage(json);
|
||||||
|
if (Config::Current()->DebugEnabled)
|
||||||
|
blog(LOG_DEBUG, "Response << '%s'", json);
|
||||||
|
|
||||||
|
obs_data_release(response);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool WSRequestHandler::hasField(const char* name)
|
bool WSRequestHandler::hasField(const char* name)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user