mirror of
https://github.com/m1k1o/neko.git
synced 2024-07-24 14:40:50 +12:00
logs correctly parse error.
This commit is contained in:
@ -28,9 +28,17 @@ export class NekoLogger extends Logger {
|
||||
|
||||
protected _send(level: string, message: string, fields?: Record<string, any>) {
|
||||
if (!fields) {
|
||||
fields = { scope: this._scope }
|
||||
fields = { submodule: this._scope }
|
||||
} else {
|
||||
fields['scope'] = this._scope
|
||||
fields['submodule'] = this._scope
|
||||
}
|
||||
|
||||
for (const key in fields) {
|
||||
const field = fields[key]
|
||||
|
||||
if (field instanceof Error) {
|
||||
fields[key] = (field as Error).message
|
||||
}
|
||||
}
|
||||
|
||||
const payload = { level, message, fields } as message.SystemLog
|
||||
|
Reference in New Issue
Block a user