mirror of
https://github.com/qaiu/netdisk-fast-download.git
synced 2026-06-10 23:47:29 +00:00
fix: replace printStackTrace/System.out.println with logger in JsHttpClient, PlaygroundApi, LogStatistics, CacheServiceImpl, JsPlaygroundExecutor, JsPlaygroundLogger
This commit is contained in:
@@ -48,6 +48,6 @@ public class LogStatistics implements AfterInterceptor {
|
||||
.execute(info)
|
||||
.onSuccess(res -> {
|
||||
log.info("inserted log: id={}, path={}, code={}", info.getId(), info.getPath(), info.getCode());
|
||||
}).onFailure(Throwable::printStackTrace);
|
||||
}).onFailure(e -> log.error("插入解析日志失败: id={}", info.getId(), e));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -704,6 +704,7 @@ public class PlaygroundApi {
|
||||
if (throwable == null) {
|
||||
return "";
|
||||
}
|
||||
log.error("获取异常堆栈信息", throwable);
|
||||
java.io.StringWriter sw = new java.io.StringWriter();
|
||||
java.io.PrintWriter pw = new java.io.PrintWriter(sw);
|
||||
throwable.printStackTrace(pw);
|
||||
|
||||
@@ -104,7 +104,7 @@ public class CacheServiceImpl implements CacheService {
|
||||
promise.complete(result);
|
||||
// 更新缓存
|
||||
cacheManager.cacheShareLink(cacheLinkInfo);
|
||||
cacheManager.updateTotalByField(cacheKey, CacheTotalField.API_PARSER_TOTAL).onFailure(Throwable::printStackTrace);
|
||||
cacheManager.updateTotalByField(cacheKey, CacheTotalField.API_PARSER_TOTAL).onFailure(e -> log.error("更新API解析计数失败: cacheKey={}", cacheKey, e));
|
||||
}).onFailure(promise::fail);
|
||||
} else {
|
||||
// 缓存命中,生成过期时间并生成下载命令
|
||||
@@ -120,7 +120,7 @@ public class CacheServiceImpl implements CacheService {
|
||||
|
||||
promise.complete(result);
|
||||
cacheManager.updateTotalByField(cacheKey, CacheTotalField.CACHE_HIT_TOTAL)
|
||||
.onFailure(Throwable::printStackTrace);
|
||||
.onFailure(e -> log.error("更新缓存命中计数失败: cacheKey={}", cacheKey, e));
|
||||
}
|
||||
}).onFailure(t -> promise.fail(t.fillInStackTrace()));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user