Install the package using npm:
npm install @nexusmutual/utils
The log-level
library provides a utility to manage and handle logging levels in your application.
import { setLogLevel } from '@nexusmutual/utils';
Call setLogLevel
at the start of the entry point to configure log levels.
setLogLevel(process.env.LOG_LEVEL);
The log-level
utility supports the following logging levels (case insensitive) and ordered from the most verbose to the least verbose logging:
all
: Enables logging of all levels.trace
: Enables logging oftrace
,debug
,info
,warn
, anderror
.debug
: Enables logging ofdebug
,info
,warn
, anderror
. Disablestrace
.info
: Enables logging ofinfo
,log
,warn
, anderror
. Disablestrace
anddebug
. Same aslog
log
: Enables logging oflog
,info
,warn
, anderror
. Disablestrace
anddebug
. Same asinfo
warn
: Enables logging ofwarn
anderror
. Disablestrace
,debug
, andinfo
.error
: Enables logging oferror
only. Disablestrace
,debug
,info
andwarn
.silence
: Disables all logging output.
Install all dependencies with:
npm ci
To build the library locally, run:
npm run build
This will compile the TypeScript code into JavaScript in the dist
folder.