Socket
Socket
Sign inDemoInstall

pino-pretty

Package Overview
Dependencies
Maintainers
3
Versions
88
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


Version published
Maintainers
3
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 09 Jun 2024

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc