miami-vice
v1.4.0
Published
cute & powerful ndjson log formatter for pino inspired by pino-colada
Downloads
21
Readme
miami-vice 🍹+🍓
A cute & powerful ndjson formatter for pino.
Heavily inspired by pino-colada with lots of error & debug formatting mixed in.
For those of you wondering... a Miami Vice is half Piña Colada and half Strawberry Daiquiri 😉
Usage
Pipe Output (recommended)
Pipe a server that uses pino into miami-vice for logging.
node server.js | miami-vice
In Process (as a prettifier)
const pino = require('pino');
const logger = pino({
prettyPrint: true,
prettifier: require('miami-vice')
});
miami-vice
After parsing input from server.js
, miami-vice returns a stream and pipes it
over to process.stdout
. It will output a timestamp, a log level in a form of
an emoji, and a message.
For warn
, error
and fatal
log levels any log record properties that are not automatically handled are printed
after the primary log message to aid in debugging.
Error and stack trace information is always included and formatted for excellent readability whenever
an err
or error
property is discovered.
Express and Fastify request & response messages are handled including adding request ids to the log's namespace and name format (wrapped in brackets).
Install
npm install miami-vice