node package manager
Loosely couple your services. Use Orgs to version and reuse your code. Create a free org »

kepek-logger

kepek-logger

Build Status

The Console API wrapper with silent mode and logging depending on the chosen log level.

Preview

Installation

$ npm install --save kepek-logger

Usage

window.console = require('kepek-logger')({
    silent: false, // isDebugMode 
});

Documentation

Options

silent

A bool to specify silent mode. It will help you to hide all console messages.

Defaults to false.

silent: false

level

A string to specify the log level.

Defaults to debug.

level: 'debug'

prefix

Specify this option if you want to set a prefix for all log messages. Must be a string.

Defaults to undefined.

prefix: function () {
    return new Date().toString();
}

API

Support browser native console API. See https://goo.gl/QC43CC for more details.

License

MIT

ఠ ͟ಠ Pull requests are welcome, naturally