|
|
@@ -3,6 +3,7 @@ package com.sheep.gamegroup.model.util;
|
|
|
import android.text.TextUtils;
|
|
|
|
|
|
import com.sheep.gamegroup.model.api.BaseMessageConverter;
|
|
|
+import com.sheep.gamegroup.util.StringUtils;
|
|
|
|
|
|
import java.io.EOFException;
|
|
|
import java.io.IOException;
|
|
|
@@ -112,7 +113,7 @@ public class LogInterceptor implements Interceptor {
|
|
|
if (isPlaintext(buffer)) {
|
|
|
String result = buffer.readString(charset);
|
|
|
String json = BaseMessageConverter.decrypt(result);
|
|
|
- this.logger.log(isDecrypt && !TextUtils.equals(result, json) ? "\n" + result + "\n" + json : "\n" + json);
|
|
|
+ this.logger.log(isDecrypt && !TextUtils.equals(result, json) ? "\n" + result + "\n" + StringUtils.parseJson(json) : "\n" + StringUtils.parseJson(json));
|
|
|
this.logger.log("--> END " + request.method() + " (" + requestBody.contentLength() + "-byte body)");
|
|
|
} else {
|
|
|
this.logger.log("--> END " + request.method() + " (binary " + requestBody.contentLength() + "-byte body omitted)");
|
|
|
@@ -188,7 +189,7 @@ public class LogInterceptor implements Interceptor {
|
|
|
this.logger.log("");
|
|
|
String result = buffer.clone().readString(charset);
|
|
|
String json = BaseMessageConverter.decrypt(result);
|
|
|
- this.logger.log(isDecrypt && !TextUtils.equals(result, json) ? "\n" + result + "\n" + json : "\n" + json);
|
|
|
+ this.logger.log(isDecrypt && !TextUtils.equals(result, json) ? "\n" + result + "\n" + StringUtils.parseJson(json) : "\n" + StringUtils.parseJson(json));
|
|
|
}
|
|
|
|
|
|
if (gzippedLength != null) {
|