hxb
2024-02-23 a6c0ac0f20d1d91fbe1fe591a6a9ca46f82399f5
HDLLinkPMSdk/src/main/java/com/hdl/linkpm/sdk/utils/HDLExceptionSubmitUtils.java
@@ -1,5 +1,9 @@
package com.hdl.linkpm.sdk.utils;
import android.text.TextUtils;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.google.gson.JsonObject;
import com.hdl.linkpm.sdk.core.exception.HDLException;
import com.hdl.linkpm.sdk.core.exception.HDLLinkCopyException;
@@ -37,7 +41,22 @@
    public static void submit(String requestUrl, Object json, HDLLinkCopyException e) {
        try {
            LogUtil.log(requestUrl, "code:" + e.getCode() + "--msg:" + e.getMsg() + "--params:" + HDLGsonUtils.toJson(json), null, Level.high);
            JSONObject jsonObject = JSON.parseObject(JSON.toJSONString(json));
            String utfStr = "";
            if (jsonObject != null) {
                try {
                    byte[] data = jsonObject.getBytes("data");
                    utfStr = new String(data);
                } catch (Exception e1) {
                }
            }
            if (!TextUtils.isEmpty(utfStr)) {
                LogUtil.log(requestUrl, "code:" + e.getCode() + "--msg:" + e.getMsg() + "--params:" + HDLGsonUtils.toJson(json) + "--utf-8:" + utfStr, null, Level.high);
            } else {
                LogUtil.log(requestUrl, "code:" + e.getCode() + "--msg:" + e.getMsg() + "--params:" + HDLGsonUtils.toJson(json), null, Level.high);
            }
        } catch (Exception e1) {
        }