mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-11-22 21:37:46 +00:00
20 lines
358 B
TypeScript
20 lines
358 B
TypeScript
import pino from 'pino'
|
|
|
|
const LOG_LEVEL = process.env.LOG_LEVEL || 'info'
|
|
const LOG_FORMAT = process.env.LOG_FORMAT || 'json'
|
|
|
|
const transport =
|
|
LOG_FORMAT === 'console'
|
|
? {
|
|
target: 'pino-pretty',
|
|
options: {
|
|
colorize: true,
|
|
},
|
|
}
|
|
: undefined
|
|
|
|
export const logger = pino({
|
|
level: LOG_LEVEL,
|
|
transport,
|
|
})
|