From 2194bcc9eea2e6941d58e74e741d51721c368fae Mon Sep 17 00:00:00 2001 From: Lars Hampe Date: Wed, 2 Oct 2024 15:44:20 +0200 Subject: [PATCH] feat(logger): use logtail only in dev/prod --- packages/logger/src/index.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/logger/src/index.ts b/packages/logger/src/index.ts index aea794a..df9c090 100644 --- a/packages/logger/src/index.ts +++ b/packages/logger/src/index.ts @@ -2,14 +2,13 @@ import { Logtail } from '@logtail/node' import { LogtailTransport } from '@logtail/winston' import winston from 'winston' -// Create a Logtail client -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: [], }) if (import.meta.env.NODE_ENV !== 'test') { + // Create a Logtail client + const logtail = new Logtail(process.env.BETTERSTACK_LOG_TOKEN as string) logger.add(new LogtailTransport(logtail)) }