Closed dkebler closed 4 years ago
What would it take to use the 'main' source file (exported function) as the pretty printer when creating a pino instance. I'm avoiding command-line pipes and using environment variables to control pretty printing.
So something like this....which doesn't work.
import pino from 'pino' import colada from 'pino-colada' // import serializeError from 'serialize-error' let pretty = {} if(process.env.UCI_DEV || process.env.DEBUG) { pretty = colada // pretty = pino.pretty() // pretty.pipe(process.stdout) } let LOG = process.env.UCI_LOG || process.env.UCI_DEV || process.env.DEBUG const logger = pino({ name: 'UCI', enabled: !!LOG, safe: true, serializers: { req: pino.stdSerializers.req, res: pino.stdSerializers.res } },pretty) export default logger
It won't be recommended practice, but it will be possible in pino@5: https://github.com/pinojs/pino/pull/386
pino@5
What would it take to use the 'main' source file (exported function) as the pretty printer when creating a pino instance. I'm avoiding command-line pipes and using environment variables to control pretty printing.
So something like this....which doesn't work.