Skip to content

Commit

Permalink
reword comment
Browse files Browse the repository at this point in the history
  • Loading branch information
AndyTWF committed Jul 13, 2023
1 parent 5176e80 commit 25da9a9
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions lib/src/main/java/io/ably/lib/http/HttpCore.java
Original file line number Diff line number Diff line change
Expand Up @@ -216,14 +216,14 @@ <T> T httpExecute(HttpURLConnection conn, String method, Param[] headers, Reques
byte[] body = null;
if(requestBody != null) {
body = prepareRequestBody(requestBody, conn);
// Logging level is checked before logging for performance reasons in building the entry
// Check the logging level to avoid performance hit associated with building the message
if (Log.level <= Log.VERBOSE)
Log.v(TAG, System.lineSeparator() + new String(body));
}

/* log raw request details */
Map<String, List<String>> requestProperties = conn.getRequestProperties();
// Logging level is checked before logging for performance reasons in building the entry
// Check the logging level to avoid performance hit associated with building the message
if (Log.level <= Log.VERBOSE) {
Log.v(TAG, "HTTP request: " + conn.getURL() + " " + method);
if (credentialsIncluded)
Expand Down Expand Up @@ -401,7 +401,7 @@ private Response readResponse(HttpURLConnection connection) throws IOException {
for (Map.Entry<String, List<String>> entry : caseSensitiveHeaders.entrySet()) {
if (entry.getKey() != null) {
response.headers.put(entry.getKey().toLowerCase(Locale.ROOT), entry.getValue());
// Logging level is checked before logging for performance reasons in building the entry
// Check the logging level to avoid performance hit associated with building the message
if (Log.level <= Log.VERBOSE)
for (String val : entry.getValue())
Log.v(TAG, entry.getKey() + ": " + val);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1136,7 +1136,7 @@ public void onMessage(ITransport transport, ProtocolMessage message) throws Ably
if (transport != null && this.transport != transport) {
return;
}
// Logging level is checked before logging for performance reasons in building the entry
// Check the logging level to avoid performance hit associated with building the message
if (Log.level <= Log.VERBOSE) {
Log.v(TAG, "onMessage() (transport = " + transport + "): " + message.action + ": " + new String(ProtocolSerializer.writeJSON(message)));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,14 +111,14 @@ public void send(ProtocolMessage msg) throws AblyException {
if(channelBinaryMode) {
byte[] encodedMsg = ProtocolSerializer.writeMsgpack(msg);

// Logging level is checked before logging for performance reasons in building the entry
// Check the logging level to avoid performance hit associated with building the message
if (Log.level <= Log.VERBOSE) {
ProtocolMessage decodedMsg = ProtocolSerializer.readMsgpack(encodedMsg);
Log.v(TAG, "send(): " + decodedMsg.action + ": " + new String(ProtocolSerializer.writeJSON(decodedMsg)));
}
wsConnection.send(encodedMsg);
} else {
// Logging level is checked before logging for performance reasons in building the entry
// Check the logging level to avoid performance hit associated with building the message
if (Log.level <= Log.VERBOSE)
Log.v(TAG, "send(): " + new String(ProtocolSerializer.writeJSON(msg)));
wsConnection.send(ProtocolSerializer.writeJSON(msg));
Expand Down

0 comments on commit 25da9a9

Please sign in to comment.