Package Exports
- loglayer
Readme
loglayer
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')