8.0.0 • Published 7 years ago
choo-log v8.0.0
choo-log
This project has been deprecated. All functionality has been merged into choo-devtools. Thanks for passing by!
Development logger for choo.
Usage
var log = require('choo-log')
var choo = require('choo')
var app = choo()
app.use(log())
app.mount('body')
API
logger = log(opts)
Create a new logger instance. Opts can contain:
- timing: defaults to
true
. Disable calls towindow.performance
timing API. Timing calls will not run in browsers that don't support it out of the box. - clearResourceTimings: defaults to
true
. Disable clearing the window.performance resourcetimingbuffer when full. Set tofalse
if the buffer is cleared somewhere else. - colors: defaults to the default theme of nanologger.
emitter.emit('log:<level>', msg)
Send a log event. choo-log
will pass log:<level>
events through to nanologger. For example:
emitter.emit('log:info', 'The rain in Spain stays mainly in the plain 🌧')
These are just normal events, so you can listen to them in addition to them being logged:
emitter.on('log:debug', function (msg) {
// do something with debug message
})
localStorage.setItem('logLevel', <level>)
Set the nanologger log level, e.g.:
localStorage.setItem('logLevel','debug')
Installation
$ npm install choo-log
License
8.0.0
7 years ago
7.4.0
7 years ago
7.3.0
7 years ago
7.2.1
7 years ago
7.2.0
7 years ago
7.1.0
7 years ago
7.0.1
7 years ago
7.0.0
7 years ago
7.0.0-0
7 years ago
6.1.2
7 years ago
6.1.1
7 years ago
6.1.0
7 years ago
6.0.0
7 years ago
5.0.1
7 years ago
5.0.0
7 years ago
4.0.0-1
7 years ago
4.0.0
7 years ago
3.0.1
7 years ago
3.0.0
7 years ago
2.0.1
8 years ago
2.0.0
8 years ago
1.4.1
8 years ago
1.4.0
8 years ago
1.3.1
8 years ago
1.3.0
8 years ago
1.2.0
8 years ago
1.1.0
8 years ago
1.0.0
8 years ago