mirror of
https://gitee.com/binary/weixin-java-tools.git
synced 2025-10-28 04:29:07 +08:00
🎨 优化部分日志输出,调整输出级别
This commit is contained in:
@ -1,5 +1,6 @@
|
||||
package me.chanjar.weixin.open.api.impl;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import me.chanjar.weixin.common.enums.WxType;
|
||||
import me.chanjar.weixin.common.error.WxError;
|
||||
import me.chanjar.weixin.common.error.WxErrorException;
|
||||
@ -17,8 +18,8 @@ import java.io.IOException;
|
||||
/**
|
||||
* @author <a href="https://github.com/007gzs">007</a>
|
||||
*/
|
||||
@Slf4j
|
||||
public abstract class WxOpenServiceAbstractImpl<H, P> implements WxOpenService, RequestHttp<H, P> {
|
||||
private final Logger log = LoggerFactory.getLogger(this.getClass());
|
||||
private WxOpenComponentService wxOpenComponentService = new WxOpenComponentServiceImpl(this);
|
||||
private WxOpenConfigStorage wxOpenConfigStorage;
|
||||
|
||||
@ -46,17 +47,17 @@ public abstract class WxOpenServiceAbstractImpl<H, P> implements WxOpenService,
|
||||
protected <T, E> T execute(RequestExecutor<T, E> executor, String uri, E data) throws WxErrorException {
|
||||
try {
|
||||
T result = executor.execute(uri, data, WxType.Open);
|
||||
this.log.debug("\n【请求地址】: {}\n【请求参数】:{}\n【响应数据】:{}", uri, data, result);
|
||||
log.debug("\n【请求地址】: {}\n【请求参数】:{}\n【响应数据】:{}", uri, data, result);
|
||||
return result;
|
||||
} catch (WxErrorException e) {
|
||||
WxError error = e.getError();
|
||||
if (error.getErrorCode() != 0) {
|
||||
this.log.error("\n【请求地址】: {}\n【请求参数】:{}\n【错误信息】:{}", uri, data, error);
|
||||
log.warn("\n【请求地址】: {}\n【请求参数】:{}\n【错误信息】:{}", uri, data, error);
|
||||
throw new WxErrorException(error, e);
|
||||
}
|
||||
return null;
|
||||
} catch (IOException e) {
|
||||
this.log.error("\n【请求地址】: {}\n【请求参数】:{}\n【异常信息】:{}", uri, data, e.getMessage());
|
||||
log.warn("\n【请求地址】: {}\n【请求参数】:{}\n【异常信息】:{}", uri, data, e.getMessage());
|
||||
throw new WxRuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user