Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

pino-pretty

Package Overview
Dependencies
Maintainers
4
Versions
91
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pino-pretty

Prettifier for Pino log lines

  • 5.1.3
  • Source
  • npm
  • Socket score

Version published
Maintainers
4
Created

What is pino-pretty?

The pino-pretty npm package is a module that can be used to format logs produced by Pino, a Node.js logging library. It takes raw log lines in JSON format and transforms them into a more human-readable form. This is particularly useful during development when you need to quickly understand log output.

What are pino-pretty's main functionalities?

Pretty Printing

This feature allows you to format your logs in a more readable way, with options such as colorization for different log levels.

const pino = require('pino');
const pretty = require('pino-pretty');
const stream = pretty({ colorize: true });
const logger = pino(stream);
logger.info('This is a pretty-printed log message.');

Custom Log Formatting

Pino-pretty allows for custom log formatting, including options to translate timestamps and ignore certain fields.

const pino = require('pino');
const pretty = require('pino-pretty');
const stream = pretty({
  translateTime: 'SYS:standard',
  ignore: 'pid,hostname'
});
const logger = pino(stream);
logger.info('Custom formatted log message.');

Integration with Pino Logger

Pino-pretty can be seamlessly integrated with Pino logger to provide pretty-printing capabilities directly within the logger configuration.

const pino = require('pino');
const logger = pino({
  prettyPrint: {
    colorize: true
  }
});
logger.info('Integrated pino-pretty with Pino logger.');

Other packages similar to pino-pretty

Keywords

FAQs

Package last updated on 10 Aug 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc