fary-client-log
v1.0.4
Published
A friendly logger for client/browser, attached with vue logger.
Downloads
4
Readme
fary-client-log
Usage
For common use:
import log from 'fary-client-log'
const testLogger = log('namespace')
testLogger.log('log'/* and other ...anything */)
testLogger.warn('warn'/* and other ...anything */)
testLogger.error('error'/* and other ...anything */)
// the namespace in the console result will be colorful
For Vue component use:
import Vue from 'vue'
import { vueLogger } from 'fary-client-log'
// It will add `log`, `warn`, `error` three methods to Vue prototype
Vue.use(vueLogger)
// Then in any Vue component instance:
this.log('log'/* and other ...anything */)
this.warn('warn'/* and other ...anything */)
this.error('error'/* and other ...anything */)
// the component name(if found) in the console result will be colorful