@mobilabs/kzlog

1.0.4 • Public • Published

KZlog

NPM version GitHub last commit Github workflow Test coverage npm bundle size License

KZlog is a minimal lightweight logging library in Javascript that runs on the browser and on Node.JS.

Quick Startup

// name {String}: the name of the module/library,
// level {String}: the threshold level,
// highlight {Boolean}: log message printed in color or B&W,
const log = KZlog(name, level, highlight);
log.warn(message);
// output: [2019-4-17 18:39:37:357] [error] name: aaaa

API

Methods

KZlog provides the following methods:

Methods Description
help dumps, to the console, the on-line
version returns the version of the library
setName updates the name of the module/library to be displayed
setLevel updates the threshold level
setHighlight updates the highlight mode
trace dumps a trace message
debug dumps a debug message
info dumps a info message
warn dumps a warn message
error dumps a error message
fatal dumps a fatal message

Threshold level

The default threshold level is trace. It can be set to trace, debug, info, warn, error, fatal or off.

License

MIT.

Readme

Keywords

Package Sidebar

Install

npm i @mobilabs/kzlog

Weekly Downloads

0

Version

1.0.4

License

MIT

Unpacked Size

43.9 kB

Total Files

9

Last publish

Collaborators

  • jclo