mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-17 09:36:08 +08:00
core: judge: update logger
This commit is contained in:
1 file changed
+5
-1
@@ -211,7 +211,11 @@ class JudgeConnectionHandler extends ConnectionHandler {
|
||||
}
|
||||
|
||||
async message(msg) {
|
||||
if (msg.key !== 'ping' && msg.key !== 'prio') logger[['status', 'next'].includes(msg.key) ? 'debug' : 'info']('%o', omit(msg, 'key'));
|
||||
if (msg.key !== 'ping' && msg.key !== 'prio') {
|
||||
const method = ['status', 'next'].includes(msg.key) ? 'debug' : 'info';
|
||||
const keys = method === 'debug' ? ['key'] : ['key', 'subtasks', 'cases'];
|
||||
logger[method]('%o', omit(msg, keys));
|
||||
}
|
||||
if (msg.key === 'next') await next(msg);
|
||||
else if (msg.key === 'end') {
|
||||
if (!msg.nop) await end({ judger: this.user._id, ...msg }).catch((e) => logger.error(e));
|
||||
|
||||
Reference in new issue
Block a user