Initial commit
This commit is contained in:
18
apps/backend/src/lib/logger.ts
Normal file
18
apps/backend/src/lib/logger.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
import pino from 'pino'
|
||||
|
||||
const isProd = Bun.env.NODE_ENV === 'production'
|
||||
|
||||
export const logger = pino({
|
||||
level: Bun.env.LOG_LEVEL ?? (isProd ? 'info' : 'debug'),
|
||||
transport: isProd
|
||||
? undefined
|
||||
: {
|
||||
target: 'pino-pretty',
|
||||
options: {
|
||||
colorize: true,
|
||||
singleLine: true,
|
||||
translateTime: 'SYS:standard',
|
||||
ignore: 'pid,hostname',
|
||||
},
|
||||
},
|
||||
})
|
||||
Reference in New Issue
Block a user