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 <git@herrmehren.de>
This commit is contained in:
David Mehren 2022-04-17 21:33:31 +02:00
parent 819dd8f568
commit 3cff7f861a

View file

@ -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 = {