Skip to content

Commit

Permalink
fix env
Browse files Browse the repository at this point in the history
  • Loading branch information
ermalkaleci committed Jan 26, 2024
1 parent f9d46a5 commit 719853a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/core/src/logger.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
import { pino } from 'pino'

const level = (typeof process === 'object' && process.env.LOG_LEVEL) || 'info'
const hideObject = (typeof process === 'object' && !!process.env.LOG_COMPACT) || false

export const pinoLogger = pino({
level: (typeof process === 'object' && process.env.LOG_LEVEL) || 'info',
level,
transport: {
target: 'pino-pretty',
options: {
ignore: 'pid,hostname',
hideObject: !!process.env.LOG_COMPACT,
hideObject,
},
},
})
Expand Down

0 comments on commit 719853a

Please sign in to comment.