mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2026-02-13 00:10:27 +00:00
fix: 整理日志、添加颜色、使用统一的日志函数以提高日志可读性
This commit is contained in:
@@ -7,6 +7,7 @@ import { WebUiConfig } from './src/helper/config';
|
||||
const app = express();
|
||||
import { dirname } from 'node:path';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
import { log } from '@/common/utils/log';
|
||||
|
||||
|
||||
const __filename = fileURLToPath(import.meta.url);
|
||||
@@ -32,8 +33,8 @@ export async function InitWebUi() {
|
||||
//挂载API接口
|
||||
app.use('/api', ALLRouter);
|
||||
app.listen(config.port, async () => {
|
||||
console.log(`[NapCat] [WebUi] Current WebUi is running at IP:${config.port}`);
|
||||
console.log(`[NapCat] [WebUi] Login Token is ${config.token}`);
|
||||
log(`[NapCat] [WebUi] Current WebUi is running at IP:${config.port}`);
|
||||
log(`[NapCat] [WebUi] Login Token is ${config.token}`);
|
||||
});
|
||||
|
||||
}
|
||||
@@ -3,6 +3,7 @@ import { resolve } from 'node:path';
|
||||
import * as net from 'node:net';
|
||||
import { dirname } from 'node:path';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
import { logError } from '@/common/utils/log';
|
||||
|
||||
|
||||
const __filename = fileURLToPath(import.meta.url);
|
||||
@@ -78,7 +79,7 @@ class WebUiConfigWrapper {
|
||||
this.WebUiConfigData = parsedConfig;
|
||||
return this.WebUiConfigData;
|
||||
} catch (e) {
|
||||
console.error('读取配置文件失败', e);
|
||||
logError('读取配置文件失败', e);
|
||||
}
|
||||
return {} as WebUiConfigType; // 理论上这行代码到不了,为了保持函数完整性而保留
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user