Function
Static Public Summary | ||
public |
formatError(error: Error): string Transform an error into a user-readable, colored string. |
|
public |
Utility function that will create a new instance of |
|
public |
Add characters at the begenning of every line of a multi-line string. |
Static Public
public formatError(error: Error): string source
import {formatError} from 'hiplog/src/index.js'
Transform an error into a user-readable, colored string.
Params:
Name | Type | Attribute | Description |
error | Error | Input error. |
public fromEnv(options: Object, env: Object, environment: string): Log source
import {fromEnv} from 'hiplog/src/index.js'
Utility function that will create a new instance of Log
with options taken
from environment variables.
Variables:
NODE_ENV
:'development'
(default):displayTime
is disabled,'test'
:displayTime
is disabled,'level'
is set to'critical'
,'production'
: Use default values for each option.
LOG
: Setslevel
value.LOG_LEVEL
: Alias forLOG
.LOG_TIME
: When set totrue
or1
, enablesdisplayTime
.LOG_TIME_FORMAT
: SetsdisplayTimeFormat
value.