@livy/html-oneline-formatter
TypeScript icon, indicating that this package has built-in type declarations

1.0.4 • Public • Published

@livy/html-oneline-formatter

This Livy formatter formats log records as single-line HTML.

Basic Example

const { FileHandler } = require('@livy/file-handler')
const { HtmlOnelineFormatter } = require('@livy/html-oneline-formatter')

const handler = new FileHandler('logs.html', {
  formatter: new HtmlOnelineFormatter()
})

Installation

Install it via npm:

npm install @livy/html-oneline-formatter

Options

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

The following options are available:

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
}

theme

Type: HtmlFormatterThemeInterface

Default: {}

Description: The color theme to use. A couple of included themes can be found in the themes folder.

wrap

Type: HtmlFormatterThemeInterface

Default: false

Description: Whether to allow lines to wrap when they're too long for the display.

Public API

include

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

theme

The color theme to use. Initially set through the theme option.

wrap

Whether to allow lines to wrap when they're too long for the display. Initially set through the wrap option.

Package Sidebar

Install

npm i @livy/html-oneline-formatter

Weekly Downloads

1

Version

1.0.4

License

MIT

Unpacked Size

40.1 kB

Total Files

27

Last publish

Collaborators

  • loilo