Home

Awesome

choo-log stability

npm version build status downloads js-standard-style

This project has been deprecated. All functionality has been merged into choo-devtools. Thanks for passing by!

Development logger for choo.

screen capture

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:

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

MIT