From f1156b856b8e815b60e38cc1aebdc88a9dbabf9e Mon Sep 17 00:00:00 2001 From: Joe Hansche Date: Thu, 23 Mar 2017 12:26:36 -0700 Subject: [PATCH] Log outgoing JSON This may become unnecessary if/when we move to OkHttp3 (#19). But for now it's the only way to see the exact JSON data that is being sent over the websocket. --- .../src/main/java/com/parse/ParseLiveQueryClientImpl.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ParseLiveQuery/src/main/java/com/parse/ParseLiveQueryClientImpl.java b/ParseLiveQuery/src/main/java/com/parse/ParseLiveQueryClientImpl.java index 5cf4f45..6be8b29 100644 --- a/ParseLiveQuery/src/main/java/com/parse/ParseLiveQueryClientImpl.java +++ b/ParseLiveQuery/src/main/java/com/parse/ParseLiveQueryClientImpl.java @@ -125,6 +125,9 @@ private Task sendOperationAsync(final ClientOperation clientOperation) { public Void call() throws Exception { JSONObject jsonEncoded = clientOperation.getJSONObjectRepresentation(); String jsonString = jsonEncoded.toString(); + if (Parse.getLogLevel() <= Parse.LOG_LEVEL_DEBUG) { + Log.d(LOG_TAG, "Sending over websocket: " + jsonString); + } webSocketClient.send(jsonString); return null; }