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.
{ return a: 'a' b: 'b' ; } { this$log; this$log; this$log; this$log; this$log; };
License
Copyright (c) webcore-it