1.2.1 • Published 9 months ago

@jazzxp/pino-extended v1.2.1

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

Pino Extended

JSR NPM Version GitHub Release

License CodeQL

Extends Pino with a couple of useful abilities.

Firstly we log on going out of scope (by leveraging Javascript's using keyword), rather than immediately. This allows us to easily compute and log run times.

To go along with that, if you log the same field multiple times, it will convert it into an array so you won't lose data.

Installation

NPM

npm install @jazzxp/pino-extended

Github

npm login --scope=@jazzxp --auth-type=legacy --registry=https://npm.pkg.github.com
npm install @jazzxp/pino-extended

JSR

npx jsr add @jazzxp/pino-extended

Basic Usage

using log = startLog('EventName');
log.log({message: 'message'});

Advanced Usage

Automatically switch the event to another level

using log = startLog('EventName');
log.error({message: 'message'});

Change the default event level

using log = startLog('EventName', 'warn');
log.log({message: 'message'});
1.2.1

9 months ago

1.2.0

9 months ago

1.1.3

9 months ago

1.1.2

9 months ago

1.1.1

9 months ago