vue-logger-mixin

0.2.0 • Public • Published

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

Readme

Keywords

Package Sidebar

Install

npm i vue-logger-mixin

Weekly Downloads

1

Version

0.2.0

License

MIT

Unpacked Size

4.63 kB

Total Files

5

Last publish

Collaborators

  • felixpy