diff --git a/packages/utils/src/logger/interface.ts b/packages/utils/src/logger/interface.ts index b492c1a3662d..9ea9dd82b9cf 100644 --- a/packages/utils/src/logger/interface.ts +++ b/packages/utils/src/logger/interface.ts @@ -6,7 +6,7 @@ export enum LogLevel { info = "info", verbose = "verbose", debug = "debug", - silly = "silly", + trace = "trace", } export const logLevelNum: {[K in LogLevel]: number} = { @@ -15,21 +15,13 @@ export const logLevelNum: {[K in LogLevel]: number} = { [LogLevel.info]: 2, [LogLevel.verbose]: 3, [LogLevel.debug]: 4, - [LogLevel.silly]: 5, + /** Request in https://github.com/ChainSafe/lodestar/issues/4536 by eth-docker */ + [LogLevel.trace]: 5, }; // eslint-disable-next-line @typescript-eslint/naming-convention export const LogLevels = Object.values(LogLevel); -export const customColors = { - error: "red", - warn: "yellow", - info: "white", - verbose: "green", - debug: "pink", - silly: "purple", -}; - export const defaultLogLevel = LogLevel.info; export type LogFormat = "human" | "json"; diff --git a/packages/utils/src/logger/winston.ts b/packages/utils/src/logger/winston.ts index 0361ded0c462..486da840ed1b 100644 --- a/packages/utils/src/logger/winston.ts +++ b/packages/utils/src/logger/winston.ts @@ -1,6 +1,6 @@ import winston from "winston"; import type {Logger} from "winston"; -import {ILogger, ILoggerOptions, LoggerChildOpts, LogLevel} from "./interface.js"; +import {ILogger, ILoggerOptions, LoggerChildOpts, LogLevel, logLevelNum} from "./interface.js"; import {getFormat} from "./format.js"; import {LogData} from "./json.js"; @@ -50,6 +50,7 @@ export class WinstonLogger implements ILogger { format: getFormat(options), transports, exitOnError: false, + levels: logLevelNum, }) ); } @@ -74,8 +75,8 @@ export class WinstonLogger implements ILogger { this.createLogEntry(LogLevel.debug, message, context, error); } - silly(message: string, context?: LogData, error?: Error): void { - this.createLogEntry(LogLevel.silly, message, context, error); + trace(message: string, context?: LogData, error?: Error): void { + this.createLogEntry(LogLevel.trace, message, context, error); } child(options: LoggerChildOpts): WinstonLogger {