Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including @mobilabs/kzlog with all npm packages installed. Try it out:

var kzlog = require("@mobilabs/kzlog")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

@mobilabs/kzlog v0.0.6

A minimal lightweight logging library for JavaScript

KZlog

NPM version Travis CI Test coverage Dependencies status Dev Dependencies status License

NPM install

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,
var 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:

MethodsDescription
helpdumps, to the console, the on-line
versionreturns the version of the library
setNameupdates the name of the module/library to be displayed
setLevelupdates the threshold level
setHighlightupdates the highlight mode
tracedumps a trace message
debugdumps a debug message
infodumps a info message
warndumps a warn message
errordumps a error message
fataldumps 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.

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free