From dc97053d044a1c7ad9779bcdfc7db8ce6005192c Mon Sep 17 00:00:00 2001 From: Lars Hampe Date: Wed, 2 Oct 2024 15:42:18 +0200 Subject: [PATCH] feat: disable logger on testing --- apps/api/src/utils/startup.ts | 1 + apps/app/tsconfig.tsbuildinfo | 2 +- packages/logger/src/index.ts | 6 +++++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/apps/api/src/utils/startup.ts b/apps/api/src/utils/startup.ts index b926848..a65a76c 100644 --- a/apps/api/src/utils/startup.ts +++ b/apps/api/src/utils/startup.ts @@ -23,6 +23,7 @@ export const startup = async () => { 'CLERK_WEBHOOK_SECRET', 'CLERK_SECRET_KEY', 'CLERK_PUBLISHABLE_KEY', + 'BETTERSTACK_LOG_TOKEN', ] keys.map((key) => { if (!import.meta.env[key]) { diff --git a/apps/app/tsconfig.tsbuildinfo b/apps/app/tsconfig.tsbuildinfo index 437a9b9..3dd8eda 100644 --- a/apps/app/tsconfig.tsbuildinfo +++ b/apps/app/tsconfig.tsbuildinfo @@ -1 +1 @@ -{"root":["./src/main.tsx","./src/routeTree.gen.ts","./src/vite-env.d.ts","./src/components/Layout.tsx","./src/components/Navigation.tsx","./src/components/NavigationMobile.tsx","./src/routes/__root.tsx","./src/routes/about.lazy.tsx","./src/routes/index.lazy.tsx"],"version":"5.6.2"} \ No newline at end of file +{"root":["./src/main.tsx","./src/routeTree.gen.ts","./src/vite-env.d.ts","./src/components/Layout.tsx","./src/components/Navigation.tsx","./src/components/NavigationMobile.tsx","./src/routes/__root.tsx","./src/routes/index.lazy.tsx","./src/routes/changelog/index.lazy.tsx","./src/routes/user/index.lazy.tsx","./src/utils/navigation-routes.ts"],"version":"5.6.2"} \ No newline at end of file diff --git a/packages/logger/src/index.ts b/packages/logger/src/index.ts index c966434..aea794a 100644 --- a/packages/logger/src/index.ts +++ b/packages/logger/src/index.ts @@ -7,5 +7,9 @@ const logtail = new Logtail(process.env.BETTERSTACK_LOG_TOKEN as string) // Create a Winston logger - passing in the Logtail transport export const logger = winston.createLogger({ - transports: [new LogtailTransport(logtail)], + transports: [], }) + +if (import.meta.env.NODE_ENV !== 'test') { + logger.add(new LogtailTransport(logtail)) +}