Commit 01899915 by 李学兴

Merge branch '20210702-日志规范-lxx' into qa

parents 2bbb31b1 61ce2d25
...@@ -6,14 +6,13 @@ import com.alibaba.fastjson.JSONObject; ...@@ -6,14 +6,13 @@ import com.alibaba.fastjson.JSONObject;
import com.freemud.application.sdk.api.log.ApiLog; import com.freemud.application.sdk.api.log.ApiLog;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.slf4j.helpers.MessageFormatter;
import org.springframework.beans.BeansException; import org.springframework.beans.BeansException;
import org.springframework.beans.factory.BeanFactory; import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.BeanFactoryAware; import org.springframework.beans.factory.BeanFactoryAware;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import java.text.MessageFormat;
/** /**
* All rights Reserved, Designed By www.freemud.cn * All rights Reserved, Designed By www.freemud.cn
* *
...@@ -59,7 +58,7 @@ public class ShoppingSdkLogUtil implements BeanFactoryAware { ...@@ -59,7 +58,7 @@ public class ShoppingSdkLogUtil implements BeanFactoryAware {
param3 = clone[2] instanceof String ? (String) clone[2] : JSON.toJSONString(clone[2]); param3 = clone[2] instanceof String ? (String) clone[2] : JSON.toJSONString(clone[2]);
} }
try { try {
ApiLog.printLog(MessageFormat.format(message, params), param1, param2, param3); ApiLog.printLog(MessageFormatter.arrayFormat(message, params).getMessage(), param1, param2, param3);
} catch (Exception e) { } catch (Exception e) {
com.freemud.application.sdk.api.log.ErrorLog.errorDev("LogUtil.printLog ".concat(message), e, params); com.freemud.application.sdk.api.log.ErrorLog.errorDev("LogUtil.printLog ".concat(message), e, params);
} }
......
...@@ -18,11 +18,10 @@ import com.freemud.application.sdk.api.log.ApiLog; ...@@ -18,11 +18,10 @@ import com.freemud.application.sdk.api.log.ApiLog;
import com.freemud.application.sdk.api.log.ErrorLog; import com.freemud.application.sdk.api.log.ErrorLog;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.slf4j.helpers.MessageFormatter;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import java.text.MessageFormat;
@Component @Component
public class LogUtil { public class LogUtil {
...@@ -52,7 +51,7 @@ public class LogUtil { ...@@ -52,7 +51,7 @@ public class LogUtil {
param3 = clone[2] instanceof String ? (String) clone[2] : JSON.toJSONString(clone[2]); param3 = clone[2] instanceof String ? (String) clone[2] : JSON.toJSONString(clone[2]);
} }
try { try {
ApiLog.printLog(MessageFormat.format(message, params), param1, param2, param3); ApiLog.printLog(MessageFormatter.arrayFormat(message, params).getMessage(), param1, param2, param3);
} catch (Exception e) { } catch (Exception e) {
ErrorLog.errorDev("LogUtil.printLog ".concat(message), e, params); ErrorLog.errorDev("LogUtil.printLog ".concat(message), e, params);
} }
......
...@@ -15,15 +15,13 @@ package com.freemud.application.sdk.api.ordercenter.util; ...@@ -15,15 +15,13 @@ package com.freemud.application.sdk.api.ordercenter.util;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.freemud.application.sdk.api.log.ApiLog; import com.freemud.application.sdk.api.log.ApiLog;
import com.freemud.application.sdk.api.log.ErrorLog; import com.freemud.application.sdk.api.log.ErrorLog;
import lombok.extern.log4j.Log4j;
import lombok.extern.log4j.Log4j2; import lombok.extern.log4j.Log4j2;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.slf4j.helpers.MessageFormatter;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import java.text.MessageFormat;
@Component @Component
@Log4j2 @Log4j2
public class LogUtil { public class LogUtil {
...@@ -54,7 +52,7 @@ public class LogUtil { ...@@ -54,7 +52,7 @@ public class LogUtil {
param3 = clone[2] instanceof String ? (String) clone[2] : JSON.toJSONString(clone[2]); param3 = clone[2] instanceof String ? (String) clone[2] : JSON.toJSONString(clone[2]);
} }
try { try {
ApiLog.printLog(MessageFormat.format(message, params), param1, param2, param3); ApiLog.printLog(MessageFormatter.arrayFormat(message, params).getMessage(), param1, param2, param3);
} catch (Exception e) { } catch (Exception e) {
ErrorLog.errorDev("LogUtil.printLog ".concat(message), e, params); ErrorLog.errorDev("LogUtil.printLog ".concat(message), e, params);
} }
......
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