feat: logger display error stack

This commit is contained in:
Lin, Hung-Shin committed 2023-11-26 19:21:58 +08:00
1 parent a7e646c28b
commit fb6411e923
2 files changed
+6 -3

No files matched your search

-1
View File
@@ -156,7 +156,6 @@ export default class CommandHandler extends SessionHandler {
}
// global exception
console.log(this.quest.exceptions)
if (this.quest.exceptions.length > 0) {
const globalExceptions = this.getUnlockedComponents(
this.quest.exceptions
+6 -2
View File
@@ -1,9 +1,13 @@
import winston from 'winston'
import winston, { format } from 'winston'
import config from '../config.js'
const logger = winston.createLogger({
level: 'info',
format: winston.format.json(),
format: format.combine(
format.errors({ stack: true }),
format.timestamp(),
format.json()
),
defaultMeta: { service: 'backend', timestamp: new Date().toISOString() },
transports: [
//