JSPM

@livy/line-formatter

1.0.4
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 58
  • Score
    100M100P100Q71383F
  • License MIT

Formats Livy log records as single lines

Package Exports

  • @livy/line-formatter
  • @livy/line-formatter/lib/line-formatter.js
  • @livy/line-formatter/lib/line-formatter.mjs

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@livy/line-formatter) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

@livy/line-formatter

This Livy formatter formats log records as single lines.

Basic Example

const { FileHandler } = require('@livy/file-handler')
const { LineFormatter } = require('@livy/line-formatter')

const handler = new FileHandler('logs.txt', {
  formatter: new LineFormatter()
})

Installation

Install it via npm:

npm install @livy/line-formatter

Options

An object of options can be passed to this formatter's constructor.

The following options are available:

ignoreEmptyContext

Type: boolean

Default: false

Description: Whether to omit empty context objects (only if extra is empty as well).

ignoreEmptyExtra

Type: boolean

Default: true

Description: Whether to omit empty extra objects.

include

Type: Partial<IncludedRecordProperties>

Default: {}

Description: Which log record properties to include in the output. The passed object is merged into the following default:

{
  datetime: true,
  channel: false,
  level: true,
  severity: false,
  message: true,
  context: true,
  extra: true
}

Public API

ignoreEmptyContext

Whether to omit empty context objects (only if extra is empty as well). Initially set through the ignoreEmptyContext option.

ignoreEmptyExtra

Whether to omit empty extra objects. Initially set through the ignoreEmptyExtra option.

include

Which log record properties to include in the output. Initially set through the include option.