1.0.4 • Published 3 years ago

@livy/tags-processor v1.0.4

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

@livy/tag-processor

This Livy processor adds predefined tags to a log record's extra object.


Runtime: Node.js and browsers


Basic Example

const { createLogger } = require('@livy/logger')
const { TagsProcessor } = require('@livy/tag-processor')

const logger = createLogger('app-logger', {
  processors: [
    // Adds `tags: ['demo', 'docs']` to the `extra` object
    new TagsProcessor('demo', 'docs')
  ]
})

Installation

Install it via npm:

npm install @livy/tag-processor

Options

The TagsProcessor constructor takes an arbitrary number of strings to inject as tags.

Public API

addTags(...tags)

Add tags to the processor. Duplicates will be removed.

setTags(...tags)

Set the processor's tags.

1.0.4

3 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

6 years ago

1.0.0

6 years ago