From 44497f2904924484c8b45f23f3906815372b52a9 Mon Sep 17 00:00:00 2001 From: Akalanka Perera Date: Sun, 14 Jan 2024 13:11:13 +0530 Subject: [PATCH] Fix(module-logger): object logs --- packages/module-logger/src/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/module-logger/src/index.js b/packages/module-logger/src/index.js index 12c0810..8c12c3c 100644 --- a/packages/module-logger/src/index.js +++ b/packages/module-logger/src/index.js @@ -69,7 +69,7 @@ const _createLogger = () => { return `${[..._defaultKeys, ...Object.keys(info)].reduce((acc, key, i) => { if ((info?.[key] && _defaultKeys.includes(key) && i <= 3) || (i > 3 && !_defaultKeys.includes(key))) { if (i > 0) acc += ", "; - return (acc += `"${chalk.gray(key)}": "${info[key]}"`); + return (acc += `"${chalk.gray(key)}": "${typeof info[key] === 'object' ? JSON.stringify(info[key]) : info[key]}"`); } return acc; }, "{ ")} }`;