mirror of
https://github.com/n8n-io/n8n.git
synced 2024-11-09 22:24:05 -08:00
fix(core): Fix logger error when logging circular json (#3583)
* Fix logger error when logging circular json * add type
This commit is contained in:
parent
44b64fb683
commit
3cb693d5d4
|
@ -1,5 +1,6 @@
|
|||
/* eslint-disable @typescript-eslint/no-shadow */
|
||||
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
|
||||
import { inspect } from 'util';
|
||||
import winston from 'winston';
|
||||
|
||||
import { IDataObject, ILogger, LogTypes } from 'n8n-workflow';
|
||||
|
@ -36,12 +37,12 @@ class Logger implements ILogger {
|
|||
winston.format.printf(({ level, message, timestamp, metadata }) => {
|
||||
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
|
||||
return `${timestamp} | ${level.padEnd(18)} | ${message}${
|
||||
Object.keys(metadata).length ? ` ${JSON.stringify(metadata)}` : ''
|
||||
Object.keys(metadata).length ? ` ${JSON.stringify(inspect(metadata))}` : ''
|
||||
}`;
|
||||
}),
|
||||
);
|
||||
} else {
|
||||
format = winston.format.printf(({ message }) => message);
|
||||
format = winston.format.printf(({ message }: { message: string }) => message);
|
||||
}
|
||||
|
||||
this.logger.add(
|
||||
|
|
Loading…
Reference in a new issue