0.2.0 • Published 5 years ago

vue-logger-mixin v0.2.0

Weekly downloads
2
License
MIT
Repository
github
Last release
5 years ago

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

MIT

Copyright (c) 2018, Felix Yang

0.2.0

5 years ago

0.1.2

5 years ago

0.1.1

6 years ago

0.1.0

6 years ago