vue-logger-mixin
v0.2.0
Published
A logger mixin for Vue.js which can use different appenders.
Downloads
12
Readme
vue-logger-mixin
A logger mixin for Vue.js which can use different patterns and appenders with @felixpy/logger.
Installation
Using NPM
npm i vue-logger-mixin --save
Quick Start
import Vue from 'vue'
import LoggerMixin from 'vue-logger-mixin'
Vue.use(LoggerMixin)
new Vue({
// ...
components: {
foobar: {
created() {
this.$logger.log('created', 'Hello Logger!')
}
}
}
})
// [3/3/2018, 1:19:35 AM] [LOG] [foobar->created] - Hello Logger!
Options
You can specify an options when using mixin:
Vue.use(LoggerMixin, {
// custom config
config: {
separator: '>>>',
dateFormatter: function(date) {
return date.toISOString()
}
}
})
For more details, see: @felixpy/logger.
License
Copyright (c) 2018, Felix Yang