Comparing version 6.1.1 to 6.1.2
@@ -61,2 +61,3 @@ var nanologger = require('nanologger') | ||
var index = entries.length - 1 | ||
if (index < 0) return log.info('render') | ||
var entry = entries[index] | ||
@@ -63,0 +64,0 @@ var duration = entry.duration.toFixed() |
{ | ||
"name": "choo-log", | ||
"version": "6.1.1", | ||
"version": "6.1.2", | ||
"description": "Development logger for choo", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -29,2 +29,25 @@ # choo-log [![stability][0]][1] | ||
### `emitter.emit('log:<level>', msg)` | ||
Send a log event. `choo-log` will pass `log:<level>` events through to [nanologger](https://github.com/yoshuawuyts/nanologger). For example: | ||
```js | ||
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: | ||
```js | ||
emitter.on('log:debug', function (msg) { | ||
// do something with debug message | ||
}) | ||
``` | ||
### `localStorage.setItem('logLevel', <level>)` | ||
Set the [nanologger log level](https://github.com/yoshuawuyts/nanologger#level--logloglevel), e.g.: | ||
```js | ||
localStorage.setItem('logLevel','debug') | ||
``` | ||
## Installation | ||
@@ -31,0 +54,0 @@ ```sh |
170989
58
76