kepek-logger
v1.1.4
Published
Browser console wrapper with silent mode and logging depending on the chosen log level.
Downloads
9
Maintainers
Readme
kepek-logger
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