mirror of
https://github.com/linux-odyssey/linux-odyssey.git
synced 2026-11-08 03:20:12 +08:00
feat: logger display error stack
This commit is contained in:
1 parent
a7e646c28b
commit
fb6411e923
2 files changed
+6
-3
No files matched your search
@@ -156,7 +156,6 @@ export default class CommandHandler extends SessionHandler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// global exception
|
// global exception
|
||||||
console.log(this.quest.exceptions)
|
|
||||||
if (this.quest.exceptions.length > 0) {
|
if (this.quest.exceptions.length > 0) {
|
||||||
const globalExceptions = this.getUnlockedComponents(
|
const globalExceptions = this.getUnlockedComponents(
|
||||||
this.quest.exceptions
|
this.quest.exceptions
|
||||||
|
|||||||
@@ -1,9 +1,13 @@
|
|||||||
import winston from 'winston'
|
import winston, { format } from 'winston'
|
||||||
import config from '../config.js'
|
import config from '../config.js'
|
||||||
|
|
||||||
const logger = winston.createLogger({
|
const logger = winston.createLogger({
|
||||||
level: 'info',
|
level: 'info',
|
||||||
format: winston.format.json(),
|
format: format.combine(
|
||||||
|
format.errors({ stack: true }),
|
||||||
|
format.timestamp(),
|
||||||
|
format.json()
|
||||||
|
),
|
||||||
defaultMeta: { service: 'backend', timestamp: new Date().toISOString() },
|
defaultMeta: { service: 'backend', timestamp: new Date().toISOString() },
|
||||||
transports: [
|
transports: [
|
||||||
//
|
//
|
||||||
|
|||||||
Reference in new issue
Block a user