Socket
Book a DemoInstallSign in
Socket

@kofile/production-pino-log-formatter

Package Overview
Dependencies
Maintainers
12
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@kofile/production-pino-log-formatter

[![NPM version](https://flat.badgen.net/npm/v/@kofile/production-pino-log-formatter)](https://www.npmjs.com/package/@kofile/production-pino-log-formatter) [![Build Status](https://flat.badgen.net/travis/kofile/production-pino-log-formatter)](https://travi

2.1.0
latest
npmnpm
Version published
Maintainers
12
Created
Source

Production Pino Log Formatter

NPM version Build Status semantic-release

Transport for pino

Takes

{
  "level": 30,
  "time": 1531171074631,
  "msg": "hello world",
  "pid": 657,
  "hostname": "Davids-MBP-3.fritz.box",
  "v": 1,
  "prop1": "hello",
  "prop2": 42
}

and emits

2018-07-09T21:17:54Z [INFO] hello world, prop1={hello}, prop2={42}

Install

yarn add @kofile/production-pino-log-formatter

Usage

const pino = require("pino");
const { format } = require("@kofile/production-pino-log-formatter");

const logger = pino(format());

How

In addition to configuration options, Pino accepts a destination stream to emit log entires to. This library provides a transform stream as the target which can rewrite the log entries before they're emitted to stdout.

Note that this is an in-process transport.

Pino discourages this:

Ideally, a transport should consume logs in a separate process to the application. Using transports in the same process causes unnecessary load and slows down Node's single threaded event loop.

This approach is still likely faster than using @kofile/log, though I don't have benchmarks to support that assertion.

Notes

  • No ANSI color codes. Ever.

FAQs

Package last updated on 17 Jul 2019

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.