nuxt-log
v0.1.0
Published
> A logger module for Nuxt.js using [vuejs-logger](https://github.com/justinkames/vuejs-logger)
Downloads
230
Maintainers
Readme
nuxt-log
A logger module for Nuxt.js using vuejs-logger
Setup
- Add
nuxt-log
dependency using yarn or npm to your project - Add
nuxt-log
tomodules
section ofnuxt.config.js
const logOptions = {
// optional : defaults to true if not specified
isEnabled: true,
// required ['debug', 'info', 'warn', 'error', 'fatal']
logLevel : 'debug',
// optional : defaults to false if not specified
stringifyArguments : false,
// optional : defaults to false if not specified
showLogLevel : false,
// optional : defaults to false if not specified
showMethodName : false,
// optional : defaults to '|' if not specified
separator: '|',
// optional : defaults to false if not specified
showConsoleColors: false
}
{
modules: [
['nuxt-log', logOptions],
]
}
Usage
You can use $log in almost any context using app.$log
or this.$log
.
See vuejs-logger official docs for more usage information.
export default {
data() {
return {
a: 'a',
b: 'b',
};
},
created() {
this.$log.debug('test', this.a, 123);
this.$log.info('test', this.b);
this.$log.warn('test');
this.$log.error('test');
this.$log.fatal('test');
},
};
License
Copyright (c) webcore-it