Skip to content

Commit

Permalink
Disables pretty printing in production (#552)
Browse files Browse the repository at this point in the history
  • Loading branch information
pushchris authored Dec 3, 2024
1 parent 8b9abab commit 20b12b9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
1 change: 1 addition & 0 deletions apps/platform/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ NODE_ENV=development
PORT=3001
APP_SECRET=
LOG_LEVEL=info
LOG_PRETTY_PRINT=true

DB_HOST=127.0.0.1
DB_USERNAME=parcelvoy
Expand Down
3 changes: 1 addition & 2 deletions apps/platform/src/config/logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@ import pino from 'pino'
import pretty from 'pino-pretty'
import ErrorHandler, { ErrorConfig } from '../error/ErrorHandler'

// TODO: Check ENV and disable prettier for production
export const logger = pino({
level: process.env.LOG_LEVEL || 'warn',
}, pretty({ colorize: true }))
}, process.env.LOG_PRETTY_PRINT ? pretty({ colorize: true }) : undefined)

export default async (config: ErrorConfig) => {
return new ErrorHandler(config)
Expand Down

0 comments on commit 20b12b9

Please sign in to comment.