mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
core: move some logs to debug mode
This commit is contained in:
1 parent
18bd8dfa78
commit
28a5c894f7
3 files changed
+7
-2
No files matched your search
@@ -157,7 +157,7 @@ class JudgeConnectionHandler extends ConnectionHandler {
|
||||
}
|
||||
|
||||
async message(msg) {
|
||||
if (msg.key !== 'ping') logger.info('%o', msg);
|
||||
if (msg.key !== 'ping') logger[['status', 'next'].includes(msg.key) ? 'debug' : 'info']('%o', msg);
|
||||
if (msg.key === 'next') await next(msg);
|
||||
else if (msg.key === 'end') {
|
||||
await end({ judger: this.user._id, ...msg }).catch((e) => logger.error(e));
|
||||
|
||||
@@ -42,6 +42,11 @@ const logger = new Logger('server');
|
||||
export const app = new Koa();
|
||||
export const server = http.createServer(app.callback());
|
||||
export const router = new Router();
|
||||
app.on('error', (error) => {
|
||||
if (error.code !== 'EPIPE' && error.code !== 'ECONNRESET' && !error.message.includes('Parse Error')) {
|
||||
logger.error('Koa app-level error', { error });
|
||||
}
|
||||
});
|
||||
|
||||
type MethodDecorator = (target: any, name: string, obj: any) => any;
|
||||
type Converter = (value: any) => any;
|
||||
|
||||
Reference in new issue
Block a user