From cf7fa2663c68e406287467d9852b6920728dda63 Mon Sep 17 00:00:00 2001 From: user Date: Sun, 1 Mar 2026 03:21:40 +0200 Subject: [PATCH] resolved logger printing garbage in terminal --- apps/main/src/routes/(main)/notifications/+page.svelte | 2 +- packages/logger/index.ts | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/apps/main/src/routes/(main)/notifications/+page.svelte b/apps/main/src/routes/(main)/notifications/+page.svelte index 1d5bd87..07c1354 100644 --- a/apps/main/src/routes/(main)/notifications/+page.svelte +++ b/apps/main/src/routes/(main)/notifications/+page.svelte @@ -8,7 +8,7 @@ import { get } from "svelte/store"; // Set breadcrumb to notifications - breadcrumbs.set([secondaryNavTree[2]]); + breadcrumbs.set([secondaryNavTree[1]]); onMount(() => { // Ensure user ID is set in the view model diff --git a/packages/logger/index.ts b/packages/logger/index.ts index 319f819..8021f0a 100644 --- a/packages/logger/index.ts +++ b/packages/logger/index.ts @@ -48,7 +48,13 @@ const consoleFormat = winston.format.combine( winston.format.timestamp({ format: "YYYY-MM-DD HH:mm:ss:ms" }), winston.format.colorize({ all: true }), winston.format.printf((info) => { - const { level, message, timestamp, ...extra } = info; + const { level, message, timestamp } = info; + + const extra = Object.fromEntries( + Object.entries(info).filter( + ([key]) => key !== "level" && key !== "message" && key !== "timestamp", + ), + ); const formattedMessage = message instanceof Error @@ -84,7 +90,6 @@ const stream = { write: (message: string) => logger.http(message.trim()) }; function getError(payload: Err, error?: any) { logger.error(JSON.stringify({ payload, error }, null, 2)); - console.error(error); return { code: payload.code, message: payload.message,