fix: 替换 e.printStackTrace() 和 System.out.println 为 logger 调用

- HttpProxyVerticle: err.printStackTrace() / e.printStackTrace() -> LOGGER.error()
- RouterHandlerFactory: 5处 printStackTrace() -> LOGGER.error()
- CommonUtil: e.printStackTrace() -> LOGGER.error()
- ReflectionUtil: 新增 LOGGER,3处 printStackTrace() -> LOGGER.error()
- CreateDatabase: e.printStackTrace() -> LOGGER.error()
- URLUtil: 新增 LOGGER,e.printStackTrace() -> LOGGER.error()
- LzTool: e.printStackTrace() -> log.error()
- MkwTool: 3处 System.out.println + 1处 printStackTrace -> log.debug()/log.error()
- PdbTool: e.printStackTrace() -> log.error()
- ParserApi: t.printStackTrace() -> log.error()
- CacheManager: 2处 Throwable::printStackTrace -> LOGGER.error()
- QQTool: 3处 System.out.println -> log.debug()
- FjTool: System.out.println -> log.debug()
This commit is contained in:
yukaidi
2026-05-29 02:50:06 +08:00
parent aef1b9ab11
commit 746c7ad5b3
13 changed files with 35 additions and 26 deletions

View File

@@ -497,7 +497,7 @@ public class FjTool extends PanBase {
JsonArray list;
try {
JsonObject jsonObject = asJson(res);
System.out.println(jsonObject.encodePrettily());
log.debug("目录列表: {}", jsonObject.encodePrettily());
list = jsonObject.getJsonArray("list");
} catch (Exception e) {
log.error("解析目录失败: {}", res.bodyAsString());

View File

@@ -107,7 +107,7 @@ public class LzTool extends PanBase {
try {
setFileInfo(html, shareLinkInfo);
} catch (Exception e) {
e.printStackTrace();
log.error("文件信息解析异常", e);
}
// 匹配iframe
Pattern compile = Pattern.compile("src=\"(/fn\\?[a-zA-Z\\d_+/=]{16,})\"");

View File

@@ -35,13 +35,13 @@ public class MkwTool extends PanBase {
Pattern pattern = Pattern.compile(regex);
Matcher matcher = pattern.matcher(cookie);
if (matcher.find()) {
System.out.println(matcher.group(1));
System.out.println(matcher.group(2));
log.debug("cookie key: {}", matcher.group(1));
log.debug("cookie value: {}", matcher.group(2));
var key = matcher.group(1);
var token = matcher.group(2);
String sign = JsExecUtils.getKwSign(token, key);
System.out.println(sign);
log.debug("sign: {}", sign);
clientSession.getAbs(UriTemplate.of(API_URL)).setTemplateParam("mid", shareLinkInfo.getShareKey())
.putHeader("Secret", sign).send().onSuccess(res -> {
JsonObject json = asJson(res);
@@ -54,7 +54,7 @@ public class MkwTool extends PanBase {
}
} catch (Exception e) {
e.printStackTrace();
log.error("解析失败", e);
fail("解析失败");
}
});

View File

@@ -85,7 +85,7 @@ public class PdbTool extends PanBase implements IPanTool {
})
.onFailure(handleFail());
} catch (Exception e) {
e.printStackTrace();
log.error("URL编码异常", e);
}
})

View File

@@ -74,9 +74,9 @@ public class QQTool extends PanBase {
});
// 调试匹配的情况
System.out.println("文件名称: " + filename);
System.out.println("文件大小: " + filesize);
System.out.println("文件直链: " + fileurl);
log.debug("文件名称: {}", filename);
log.debug("文件大小: {}", filesize);
log.debug("文件直链: {}", fileurl);
// 提交
promise.complete(fileurl.replace("\\x26", "&"));

View File

@@ -2,6 +2,9 @@ package cn.qaiu.util;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.net.URL;
import java.net.URLDecoder;
import java.nio.charset.StandardCharsets;
@@ -10,6 +13,8 @@ import java.util.Map;
public class URLUtil {
private static final Logger LOGGER = LoggerFactory.getLogger(URLUtil.class);
private final Map<String, String> queryParams = new HashMap<>();
// 构造函数传入URL并解析参数
@@ -31,7 +36,7 @@ public class URLUtil {
}
}
} catch (Exception e) {
e.printStackTrace();
LOGGER.error("URL解析失败: {}", url, e);
}
}