From 840fc9213410ac407ea311f88b2076ef5146d6d6 Mon Sep 17 00:00:00 2001 From: Victor Korzunin <5180700+floydspace@users.noreply.github.com> Date: Mon, 12 Aug 2024 13:52:11 +0200 Subject: [PATCH] fix: logger message string since effect v3.5 --- .changeset/tricky-peas-laugh.md | 5 +++++ packages/powertools-logger/src/Logger.ts | 6 +++++- 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 .changeset/tricky-peas-laugh.md diff --git a/.changeset/tricky-peas-laugh.md b/.changeset/tricky-peas-laugh.md new file mode 100644 index 0000000..0b8f09b --- /dev/null +++ b/.changeset/tricky-peas-laugh.md @@ -0,0 +1,5 @@ +--- +"@effect-aws/powertools-logger": patch +--- + +fix logger message string since effect v3.5 diff --git a/packages/powertools-logger/src/Logger.ts b/packages/powertools-logger/src/Logger.ts index 9dece48..9d13861 100644 --- a/packages/powertools-logger/src/Logger.ts +++ b/packages/powertools-logger/src/Logger.ts @@ -114,7 +114,11 @@ const makeLoggerInstance = (logger: Logger) => { unsafeLogger.logLevelThresholds[ options.logLevel.label === "FATAL" ? "CRITICAL" : options.logLevel.label ], - options.message, + !Array.isArray(options.message) + ? options.message + : options.message.length === 1 // since v3.5 the message is always an array + ? options.message[0] + : options.message, extraInputs, ); });