JSPM

  • Created
  • Published
  • Downloads 42066
  • Score
    100M100P100Q137599F
  • License MIT

Standardizes logging across multiple logging libraries, providing a consistent way to specify context, metadata, and errors.

Package Exports

  • loglayer

Readme

loglayer

NPM version NPM Downloads TypeScript

loglayer is a layer on top of logging libraries like pino / winston / bunyan to provide a consistent logging experience across all your projects.

For usage and supported logging libraries, see the loglayer docs.

For 4.x documentation, see the 4.x branch.

Installation

Install the core package:

npm i loglayer

Quick Start

import { LogLayer, ConsoleTransport } from 'loglayer'

const log = new LogLayer({
  transport: new ConsoleTransport({
    logger: console,
  }),
})

log
  .withMetadata({ some: 'data'})
  .withError(new Error('test'))
  .info('my message')