mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-20 03:12:15 +00: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:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user