From: Jérôme Benoit Date: Tue, 7 Feb 2023 22:47:38 +0000 (+0100) Subject: refactor(simulator): use proper type for log format X-Git-Tag: v1.1.93~7 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=63ec69b72d260925caad20eeb924d893067f521e;p=e-mobility-charging-stations-simulator.git refactor(simulator): use proper type for log format Signed-off-by: Jérôme Benoit --- diff --git a/src/utils/Logger.ts b/src/utils/Logger.ts index 4b884638..53a4bf5f 100644 --- a/src/utils/Logger.ts +++ b/src/utils/Logger.ts @@ -1,4 +1,4 @@ -import type { Format } from 'logform'; +import type { FormatWrap } from 'logform'; import { type Logger, createLogger, format, type transport } from 'winston'; import TransportType from 'winston/lib/winston/transports'; import DailyRotateFile from 'winston-daily-rotate-file'; @@ -40,7 +40,7 @@ if (Configuration.getLogRotate() === true) { const logger: Logger = createLogger({ level: Configuration.getLogLevel(), - format: format.combine(format.splat(), (format[Configuration.getLogFormat()] as () => Format)()), + format: format.combine(format.splat(), (format[Configuration.getLogFormat()] as FormatWrap)()), transports, }); @@ -53,7 +53,7 @@ if (Configuration.getLogConsole()) { new TransportType.Console({ format: format.combine( format.splat(), - (format[Configuration.getLogFormat()] as () => Format)() + (format[Configuration.getLogFormat()] as FormatWrap)() ), }) );