nuxt-logger
nuxt-logger
A small but helpful logging module for nuxt projects.
Setup
- Add
nuxt-loggerto your project using yarn or npm - Add
nuxt-loggerto themodulessection of your project'snuxt.config.js
{
modules: [
'nuxt-logger',
],
logger: {
// (optional) custom configuration
}
}
Custom configuration
logger: {
isEnabled: true, // true or false, defaults to true
logLevel: 'debug', // debug, info, warn or error, defaults to debug
}
Usage
There are 4 methods available, one for each log level (debug, info, warn, error) which accept one or more arguments of any kind.
export default {
methods:{
foo() {
this.$log.debug('foo')
this.$log.info({foo: 'bar'})
this.$log.warn('warning!')
this.$log.error('Error', 500)
}
}
}
To do
- Better support for server side rendering
- Better support for Safari and Firefox (method name missing)
Related Packages
@nuxt-hero-icons/outline
A set of free MIT-licensed high-quality SVG icons as Vue functional components.
5,626
4
Version History
| Version | Released | License |
|---|---|---|
| 0.2.0 | MIT | |
| 0.1.2 | MIT | |
| 0.1.1 | MIT | |
| 0.1.0 | MIT |