From 3cff7f861a4f0d88509b3894ad737370a22d1c1c Mon Sep 17 00:00:00 2001 From: David Mehren Date: Sun, 17 Apr 2022 21:33:31 +0200 Subject: [PATCH] fix(console-logger): don't sanitize colors away 2467b125 mistakenly applied the sanitize function to the log messages *after* the color was applied. This commit reverses the order to un-break colored logs. Signed-off-by: David Mehren --- src/logger/console-logger.service.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/logger/console-logger.service.ts b/src/logger/console-logger.service.ts index a993052f2..9a35feac4 100644 --- a/src/logger/console-logger.service.ts +++ b/src/logger/console-logger.service.ts @@ -119,11 +119,11 @@ export class ConsoleLoggerService implements LoggerService { ): void { let output; if (isObject(message)) { - output = ConsoleLoggerService.sanitize( - `${color('Object:')}\n${JSON.stringify(message, null, 2)}\n`, - ); + output = `${color('Object:')}\n${ConsoleLoggerService.sanitize( + JSON.stringify(message, null, 2), + )}\n`; } else { - output = ConsoleLoggerService.sanitize(color(message as string)); + output = color(ConsoleLoggerService.sanitize(message as string)); } const localeStringOptions: DateTimeFormatOptions = {