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 alldata
events into a file or STDOUT - Timestamp is in UTC
Install
Usage
const hlx = ;const createLogger = ; const logger = ; // Log all events into a filehlx;
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
.