For situations where you want to pretty print the logs, and doing node . | pino isn't an option.
See gioragutt/stx-amq-poc for reference. I create an interactive terminal with the vorpal library, and piping pino on execution hides the prompt.
Perhaps expose it via const {loggers: {prettyLogger}} = require(...)
Another possible implementation (expose factory method):
const createLogger = (options, ...args) => pino({serializers: serializers(), ...options}, ...args)
const logger = createLogger({})
...
// index.js
const pino = require('pino')
const {loggers: {createLogger}} = require(...)
const pretty = pino.pretty()
pretty.pipe(process.stdout)
const logger = createLogger({}, pretty)
For situations where you want to pretty print the logs, and doing
node . | pinoisn't an option.See gioragutt/stx-amq-poc for reference. I create an interactive terminal with the
vorpallibrary, and pipingpinoon execution hides the prompt.Perhaps expose it via
const {loggers: {prettyLogger}} = require(...)Another possible implementation (expose factory method):