【fix sonar】AutoLogAspect文件

This commit is contained in:
梁琦涛
2023-03-08 15:45:01 +08:00
parent eb88c3091c
commit 19c5eff30c
@@ -167,15 +167,7 @@ public class AutoLogAspect {
arguments[i] = paramsArray[i]; arguments[i] = paramsArray[i];
} }
//update-begin-author:taoyan date:20200724 for:日志数据太长的直接过滤掉 //update-begin-author:taoyan date:20200724 for:日志数据太长的直接过滤掉
PropertyFilter profilter = new PropertyFilter() { PropertyFilter profilter = (o, name, value) -> value == null || value.toString().length() <= 500;
@Override
public boolean apply(Object o, String name, Object value) {
if(value!=null && value.toString().length()>500){
return false;
}
return true;
}
};
params = JSON.toJSONString(arguments, profilter); params = JSON.toJSONString(arguments, profilter);
//update-end-author:taoyan date:20200724 for:日志数据太长的直接过滤掉 //update-end-author:taoyan date:20200724 for:日志数据太长的直接过滤掉
} else { } else {
@@ -202,7 +194,7 @@ public class AutoLogAspect {
* @return * @return
*/ */
private String getOnlineLogContent(Object obj, String content){ private String getOnlineLogContent(Object obj, String content){
if (Result.class.isInstance(obj)){ if (obj instanceof Result){
Result res = (Result)obj; Result res = (Result)obj;
String msg = res.getMessage(); String msg = res.getMessage();
String tableName = res.getOnlTable(); String tableName = res.getOnlTable();