mirror of
https://gitee.com/binary/weixin-java-tools.git
synced 2025-11-01 20:13:12 +08:00
issue #23 添加日志输出功能,使用了slf4j
This commit is contained in:
@ -31,6 +31,8 @@ import org.apache.http.impl.client.BasicCredentialsProvider;
|
||||
import org.apache.http.impl.client.BasicResponseHandler;
|
||||
import org.apache.http.impl.client.CloseableHttpClient;
|
||||
import org.apache.http.impl.client.HttpClients;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
@ -42,6 +44,8 @@ import java.util.UUID;
|
||||
|
||||
public class WxMpServiceImpl implements WxMpService {
|
||||
|
||||
protected final Logger log = LoggerFactory.getLogger(WxMpServiceImpl.class);
|
||||
|
||||
/**
|
||||
* 全局的是否正在刷新access token的锁
|
||||
*/
|
||||
@ -462,7 +466,7 @@ public class WxMpServiceImpl implements WxMpService {
|
||||
if (error.getErrorCode() == -1) {
|
||||
int sleepMillis = retrySleepMillis * (1 << retryTimes);
|
||||
try {
|
||||
System.out.println("微信系统繁忙," + sleepMillis + "ms后重试(第" + (retryTimes + 1) + "次)");
|
||||
log.debug("微信系统繁忙,{}ms 后重试(第{}次)", sleepMillis, retryTimes + 1);
|
||||
Thread.sleep(sleepMillis);
|
||||
} catch (InterruptedException e1) {
|
||||
throw new RuntimeException(e1);
|
||||
|
||||
Reference in New Issue
Block a user