Cute browser logger.
var nanologger = require('nanologger')
var log = nanologger('my-cool-logger')
log.debug('it works!')
log.info('hey')
log.warn('oh')
log.error('oh no!')
log.fatal('send help')
Create a new nanologger
instance. Name defaults to 'unknown'
. Opts should be an object with the following properties:
- colors: Key/value object used to set the colors of the logger. If any of the expected colors is not set, it will use the defaults, any extra color will be ignored.
Read the current logLevel. The log level can be set through
localStorage.setItem('logLevel', '<level>')
. It's read once at boot time.
Emit a message at loglevel 🐛
Emit a message at loglevel ✨
Emit a message at loglevel
Emit a message at loglevel 🚨
Emit a message at loglevel 💀