@pauloferreira25/nuxt3-vue3-logger
v1.0.6
Published
nuxt3-vue3-logger
Downloads
6
Readme
nuxt3-vue3-logger
nuxt3-vue3-logger for doing amazing things.
Features
Fazer um log
Quick Setup
- Add
nuxt3-vue3-logger
dependency to your project
# Using pnpm
pnpm add -D nuxt3-vue3-logger
# Using yarn
yarn add --dev nuxt3-vue3-logger
# Using npm
npm install --save-dev nuxt3-vue3-logger
- Add
@pauloferreira25/nuxt3-vue3-logger
to themodules
section ofnuxt.config.ts
export default defineNuxtConfig({
modules: [
'@pauloferreira25/nuxt3-vue3-logger'
]
})
- Create
nuxt3Vue3Logger
onapp.config.ts
import { LogLevels } from "#nuxt3-vue3-logger";
export default defineAppConfig({
nuxt3Vue3Logger: {
isEnabled: true,
logLevel : LogLevels.DEBUG,
stringifyArguments : true,
showLogLevel : true,
showMethodName : true,
separator: '|',
showConsoleColors: true
}
})
- Usage in
.vue
<script setup>
const logger = inject('nuxt3-vue3-logger').init('app');
onMounted(() => {
const log = logger.setMethodName('onMounted')
log.debug('test nada', data.a, 123)
})
</script>
That's it! You can now use nuxt3-vue3-logger in your Nuxt app ✨
Development
# Install dependencies
npm install
# Generate type stubs
npm run dev:prepare
# Develop with the playground
npm run dev
# Build the playground
npm run dev:build
# Run ESLint
npm run lint
# Run Vitest
npm run test
npm run test:watch
# Release new version
npm run release