https://github.com/felixpy/vue-logger-mixin
A logger mixin for vue which can use different patterns and appenders.
https://github.com/felixpy/vue-logger-mixin
log logger mixin vue vue-log vue-logger
Last synced: about 2 months ago
JSON representation
A logger mixin for vue which can use different patterns and appenders.
- Host: GitHub
- URL: https://github.com/felixpy/vue-logger-mixin
- Owner: felixpy
- License: mit
- Created: 2018-02-25T17:14:53.000Z (about 7 years ago)
- Default Branch: dev
- Last Pushed: 2019-04-24T10:01:52.000Z (about 6 years ago)
- Last Synced: 2025-03-16T11:16:07.115Z (about 2 months ago)
- Topics: log, logger, mixin, vue, vue-log, vue-logger
- Language: JavaScript
- Homepage:
- Size: 32.2 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# vue-logger-mixin
A logger mixin for Vue.js which can use different patterns and appenders with [@felixpy/logger](https://github.com/felixpy/logger).
## Installation
### Using NPM
```sh
npm i vue-logger-mixin --save
```## Quick Start
```js
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:
```js
Vue.use(LoggerMixin, {
// custom config
config: {
separator: '>>>',
dateFormatter: function(date) {
return date.toISOString()
}
}
})
```For more details, see: [@felixpy/logger](https://github.com/felixpy/logger).
## License
[MIT](http://opensource.org/licenses/MIT)
Copyright (c) 2018, Felix Yang