@io-arc/logger

Logging output to Terminal console.
Use Kleur to specify colors.
Kleur is also bundled, so no installation is required.

Usage#

$ npm i @io-arc/logger
index.ts
import { blue } from 'kleur'
import Logger from '@io-arc/logger'
Logger.message('Success !!!!', blue)

Methods#

No New instance.
This class is static function.

Logger.message(message[, color])#

Return: void

General purpose log.

Parameters

paramstypedefaultdescription
messagestring-Log message
color (optional)Kleur ColorKluer.resetLog color

Logger.start(task[, isBr])#

Return: void

Task stated log.
message color is blue.

Parameters

paramstypedefaultdescription
taskstring-Started task name
isBr (optional)booleanfalseCreate a new line at the top

Logger.completed(task[, isBr])#

Return: void

Task completed log.
message color is green.

Parameters

paramstypedefaultdescription
taskstring-Completed task name
isBr (optional)booleanfalseCreate a new line at the top

Logger.failed(task, error[, isNotify])#

Return: void

Task error log.
message color is red.

Parameters

paramstypedefaultdescription
taskstring-Error task name
errorError | string | null-Error message
isNotify (optional)booleantrueUsing node-notifier