Chore: add pino pretty transport #58

Merged
BenjaminPalko merged 4 commits from chore-pino-pretty into master 2025-01-22 12:47:13 -05:00
2 changed files with 15 additions and 2 deletions

4
.env
View file

@ -1,3 +1,5 @@
NODE_ENV=
DanMihailescu commented 2025-01-16 22:19:59 -05:00 (Migrated from github.com)
Review

fix eventually

fix eventually
BenjaminPalko commented 2025-01-22 11:53:09 -05:00 (Migrated from github.com)
Review

With what?

With what?
# 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

View file

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