Commit 578b8e94 by 霍志良

feat:埋点502修改

parent bc2815e8
...@@ -52,7 +52,7 @@ public class DefaultFormatPrinter { ...@@ -52,7 +52,7 @@ public class DefaultFormatPrinter {
public void printJsonRequest(@NonNull Request request, @NonNull String bodyString) { public void printJsonRequest(@NonNull Request request, @NonNull String bodyString) {
final String requestBody = LINE_SEPARATOR + BODY_TAG + LINE_SEPARATOR + bodyString; final String requestBody = LINE_SEPARATOR + BODY_TAG + LINE_SEPARATOR + bodyString;
final String tag = getTag(true); final String tag = getTag(true);
if (!request.url().toString().contains("writeMaiDianData")){
NetLogUtils.debugInfo(tag, REQUEST_UP_LINE); NetLogUtils.debugInfo(tag, REQUEST_UP_LINE);
logLines(tag, new String[]{URL_TAG + request.url()}, false); logLines(tag, new String[]{URL_TAG + request.url()}, false);
logLines(tag, getRequest(request), true); logLines(tag, getRequest(request), true);
...@@ -60,6 +60,8 @@ public class DefaultFormatPrinter { ...@@ -60,6 +60,8 @@ public class DefaultFormatPrinter {
NetLogUtils.debugInfo(tag, END_LINE); NetLogUtils.debugInfo(tag, END_LINE);
} }
}
/** /**
* 打印网络请求信息, 当网络请求时 {{@link okhttp3.RequestBody}} 为 {@code null} 或不可解析的情况 * 打印网络请求信息, 当网络请求时 {{@link okhttp3.RequestBody}} 为 {@code null} 或不可解析的情况
* *
...@@ -68,7 +70,7 @@ public class DefaultFormatPrinter { ...@@ -68,7 +70,7 @@ public class DefaultFormatPrinter {
public void printFileRequest(@NonNull Request request) { public void printFileRequest(@NonNull Request request) {
final String tag = getTag(true); final String tag = getTag(true);
if (!request.url().toString().contains("writeMaiDianData")){
NetLogUtils.debugInfo(tag, REQUEST_UP_LINE); NetLogUtils.debugInfo(tag, REQUEST_UP_LINE);
logLines(tag, new String[]{URL_TAG + request.url()}, false); logLines(tag, new String[]{URL_TAG + request.url()}, false);
logLines(tag, getRequest(request), true); logLines(tag, getRequest(request), true);
...@@ -76,6 +78,8 @@ public class DefaultFormatPrinter { ...@@ -76,6 +78,8 @@ public class DefaultFormatPrinter {
NetLogUtils.debugInfo(tag, END_LINE); NetLogUtils.debugInfo(tag, END_LINE);
} }
}
/** /**
* 打印网络响应信息, 当网络响应时 {{@link okhttp3.ResponseBody}} 可以解析的情况 * 打印网络响应信息, 当网络响应时 {{@link okhttp3.ResponseBody}} 可以解析的情况
* *
...@@ -98,7 +102,6 @@ public class DefaultFormatPrinter { ...@@ -98,7 +102,6 @@ public class DefaultFormatPrinter {
final String responseBody = LINE_SEPARATOR + BODY_TAG + LINE_SEPARATOR + bodyString; final String responseBody = LINE_SEPARATOR + BODY_TAG + LINE_SEPARATOR + bodyString;
final String tag = getTag(false); final String tag = getTag(false);
final String[] urlLine = {URL_TAG + responseUrl, N}; final String[] urlLine = {URL_TAG + responseUrl, N};
NetLogUtils.debugInfo(tag, RESPONSE_UP_LINE); NetLogUtils.debugInfo(tag, RESPONSE_UP_LINE);
logLines(tag, urlLine, true); logLines(tag, urlLine, true);
logLines(tag, getResponse(headers, chainMs, code, isSuccessful, segments, message), true); logLines(tag, getResponse(headers, chainMs, code, isSuccessful, segments, message), true);
...@@ -122,13 +125,11 @@ public class DefaultFormatPrinter { ...@@ -122,13 +125,11 @@ public class DefaultFormatPrinter {
@NonNull List<String> segments, @NonNull String message, @NonNull final String responseUrl) { @NonNull List<String> segments, @NonNull String message, @NonNull final String responseUrl) {
final String tag = getTag(false); final String tag = getTag(false);
final String[] urlLine = {URL_TAG + responseUrl, N}; final String[] urlLine = {URL_TAG + responseUrl, N};
if (!responseUrl.contains("writeMaiDianData")){
NetLogUtils.debugInfo(tag, RESPONSE_UP_LINE); NetLogUtils.debugInfo(tag, RESPONSE_UP_LINE);
logLines(tag, urlLine, true); logLines(tag, urlLine, true);
logLines(tag, getResponse(headers, chainMs, code, isSuccessful, segments, message), true); logLines(tag, getResponse(headers, chainMs, code, isSuccessful, segments, message), true);
logLines(tag, OMITTED_RESPONSE, true); logLines(tag, OMITTED_RESPONSE, true);
NetLogUtils.debugInfo(tag, END_LINE); NetLogUtils.debugInfo(tag, END_LINE);
}
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment