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

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
+6 -3
View File
@@ -1,5 +1,8 @@
const fs = require('fs-extra');
const path = require('path');
const { defaultLogger } = require('../backend/utils/logger');
// 创建logger实例
async function createPortable() {
const distDir = path.join(__dirname, '..', 'dist');
@@ -91,9 +94,9 @@ pause
await fs.ensureDir(path.join(portableDir, 'data'));
await fs.ensureDir(path.join(portableDir, 'downloads'));
console.log('✅ 便携版创建完成!');
console.log(`📁 位置: ${portableDir}`);
console.log('📦 可以将整个文件夹打包分发给用户');
logger.info('✅ 便携版创建完成!');
logger.info(`📁 位置: ${portableDir}`);
logger.info('📦 可以将整个文件夹打包分发给用户');
} catch (error) {
console.error('❌ 创建便携版失败:', error);