1.0.4 • Published 2 years ago

@livy/uid-processor v1.0.4

Weekly downloads
4
License
MIT
Repository
github
Last release
2 years ago

@livy/uid-processor

This Livy processor adds a unique identifier to a log record's extra object. The identifier is not unique per-record but created with the UidProcessor instance.


Runtime: Node.js and browsers


Basic Example

const { createLogger } = require('@livy/logger')
const { UidProcessor } = require('@livy/uid-processor')

const logger = createLogger('app-logger', {
  processors: [new UidProcessor()]
})

Installation

Install it via npm:

npm install @livy/uid-processor

Options

The UidProcessor constructor takes the length of the unique identifier (in bytes, the actual identifier will be a hex string of double the length), defaulting to 7.

Public API

reset()

This processor implements the ResettableInterface. Resetting will generate a new identifier.

You usually don't want to call this method manually on an individual processor. Consider calling it on the logger instead.

uid

Get the generated unique identifier.

1.0.4

2 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago