Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

hlx-logger

hlxjs4MIT0.0.8

A passthrough stream that skims all data and logs them into a file or stdout

video, HLS, webdav, stream, media

readme

Build Status Coverage Status Dependency Status Development Dependency Status Known Vulnerabilities XO code style

hlx-logger

A passthrough stream that skims all data and logs them into a file or stdout

Features

  • Being used with other hlx objects, it provides a functionality to log all data events into a file or STDOUT
  • Timestamp is in UTC

Install

NPM

Usage

const hlx = require('hlx');
const {createLogger} = require('hlx-logger');

const logger = createLogger({
  level: 'simple',
  outDir: '/var/log/hls-events'
});

// Log all events into a file
hlx.src('http://example.com/master.m3u8')
.pipe(logger)
.pipe(hlx.dest())
.on('error', err => {
  console.log(err.stack);
});

API

The features are built on top of the Node's transform streams.

createLogger(options)

Creates a new TransformStream object.

params

Name Type Required Default Description
options object No {} See below

options

Name Type Default Description
level string 'simple' level should be either of 'simple', 'objDump', or 'raw'
outDir string All logs are output to process.stdout outDir should be a path to a directory in which log files are stored
omitTime boolean false If true, timestamps are not logged

return value

An instance of TransformStream.