Chore: add pino pretty transport #58
2 changed files with 15 additions and 2 deletions
2
.env
2
.env
|
|
@ -1,3 +1,5 @@
|
|||
NODE_ENV=
|
||||
|
With what? With what?
|
||||
|
||||
# TWILIO
|
||||
TWILIO_ACCOUNT_SID=
|
||||
TWILIO_AUTH_TOKEN=
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue
fix eventually