diff --git a/.env b/.env index 617c806..aca61ee 100644 --- a/.env +++ b/.env @@ -1,3 +1,5 @@ +NODE_ENV= + # TWILIO TWILIO_ACCOUNT_SID= TWILIO_AUTH_TOKEN= @@ -8,4 +10,4 @@ DATABASE_URL="postgres://hestia:test123@localhost:5432/hestia" # CLERK PUBLIC_CLERK_PUBLISHABLE_KEY=secret_do_not_commit_or_change_this_create_.env.local_instead -CLERK_SECRET_KEY=secret_do_not_commit_or_change_this_create_.env.local_instead +CLERK_SECRET_KEY=secret_do_not_commit_or_change_this_create_.env.local_instead \ No newline at end of file diff --git a/src/lib/server/logger/index.ts b/src/lib/server/logger/index.ts index 7dea51d..5841c47 100644 --- a/src/lib/server/logger/index.ts +++ b/src/lib/server/logger/index.ts @@ -1,7 +1,18 @@ +import { NODE_ENV } from '$env/static/private'; import { type YogaLogger } from 'graphql-yoga'; import pino from 'pino'; -export const logger = pino(); +export const logger = pino({ + // Only use pino-pretty when NOT production + ...(NODE_ENV !== 'production' && { + transport: { + target: 'pino-pretty', + options: { + colorize: true, + }, + }, + }), +}); export const yogaLogger: YogaLogger = { debug(...args) {