后端改为使用日志记录器管理日志

This commit is contained in:
2025-08-31 18:55:22 +08:00
parent ad5dfc64cb
commit a09d6cab0e
30 changed files with 962 additions and 323 deletions
+7 -2
View File
@@ -1,3 +1,8 @@
const { defaultLogger } = require('./utils/logger');
// 创建logger实例
const logger = defaultLogger.child('ProxyConfig');
// 代理配置
const proxyConfig = {
// 系统代理配置
@@ -19,7 +24,7 @@ const proxyConfig = {
process.env.http_proxy = this.proxyUrl;
process.env.https_proxy = this.proxyUrl;
console.log('代理环境变量已设置:', this.proxyUrl);
logger.info('代理环境变量已设置:', this.proxyUrl);
},
// 清除环境变量
@@ -29,7 +34,7 @@ const proxyConfig = {
delete process.env.http_proxy;
delete process.env.https_proxy;
console.log('代理环境变量已清除');
logger.info('代理环境变量已清除');
}
};