mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2026-01-18 06:20:29 +00:00
fix: #531
This commit is contained in:
parent
eeec905df0
commit
9a65dae6a2
@ -36,7 +36,7 @@ export class LogWrapper {
|
|||||||
this.logger = winston.createLogger({
|
this.logger = winston.createLogger({
|
||||||
level: 'debug',
|
level: 'debug',
|
||||||
format: format.combine(
|
format: format.combine(
|
||||||
format.timestamp({ format: 'YYYY-MM-DD HH:mm:ss' }),
|
format.timestamp({ format: 'MM-DD HH:mm:ss' }),
|
||||||
format.printf(({ timestamp, level, message, ...meta }) => {
|
format.printf(({ timestamp, level, message, ...meta }) => {
|
||||||
const userInfo = meta.userInfo ? `${meta.userInfo} | ` : '';
|
const userInfo = meta.userInfo ? `${meta.userInfo} | ` : '';
|
||||||
return `${timestamp} [${level}] ${userInfo}${message}`;
|
return `${timestamp} [${level}] ${userInfo}${message}`;
|
||||||
@ -61,7 +61,7 @@ export class LogWrapper {
|
|||||||
]
|
]
|
||||||
});
|
});
|
||||||
|
|
||||||
this.setLogSelfInfo({ nick: '', uin: '', uid: '' });
|
this.setLogSelfInfo({ nick: '', uid: '' });
|
||||||
this.cleanOldLogs(logDir);
|
this.cleanOldLogs(logDir);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -111,8 +111,8 @@ export class LogWrapper {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
setLogSelfInfo(selfInfo: { nick: string, uin: string, uid: string }) {
|
setLogSelfInfo(selfInfo: { nick: string, uid: string }) {
|
||||||
const userInfo = `${selfInfo.nick}(${selfInfo.uin})`;
|
const userInfo = `${selfInfo.nick}`;
|
||||||
this.logger.defaultMeta = { userInfo };
|
this.logger.defaultMeta = { userInfo };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user