Chore: add pino pretty transport #58
2 changed files with 15 additions and 2 deletions
4
.env
4
.env
|
|
@ -1,3 +1,5 @@
|
||||||
|
NODE_ENV=
|
||||||
|
With what? With what?
|
|||||||
|
|
||||||
# TWILIO
|
# TWILIO
|
||||||
TWILIO_ACCOUNT_SID=
|
TWILIO_ACCOUNT_SID=
|
||||||
TWILIO_AUTH_TOKEN=
|
TWILIO_AUTH_TOKEN=
|
||||||
|
|
@ -8,4 +10,4 @@ DATABASE_URL="postgres://hestia:test123@localhost:5432/hestia"
|
||||||
|
|
||||||
# CLERK
|
# CLERK
|
||||||
PUBLIC_CLERK_PUBLISHABLE_KEY=secret_do_not_commit_or_change_this_create_.env.local_instead
|
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
|
||||||
|
|
@ -1,7 +1,18 @@
|
||||||
|
import { NODE_ENV } from '$env/static/private';
|
||||||
import { type YogaLogger } from 'graphql-yoga';
|
import { type YogaLogger } from 'graphql-yoga';
|
||||||
import pino from 'pino';
|
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 = {
|
export const yogaLogger: YogaLogger = {
|
||||||
debug(...args) {
|
debug(...args) {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue
fix eventually