Skip to content

cute & powerful ndjson log formatter for pino

License

Notifications You must be signed in to change notification settings

augusto-joecoffee/miami-vice

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

miami-vice 🍹+🍓

npm version

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 😉

miami-vice

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

Related content

License

MIT

About

cute & powerful ndjson log formatter for pino

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%