Skip to content
This repository was archived by the owner on Jan 15, 2026. It is now read-only.

DCC-BS/logger.bs.js

Repository files navigation

logger.bs.js

Important

This project is deprecated use Nuxt-Layers instead.

GitHub package.json version GitHub Actions Workflow Status codecov

Default logger use for all nuxt apps.

Quick Setup

To install the module create a .npmrc next to your package.json file:

//npm.pkg.github.com/:_authToken=${GITHUB_TOKEN}
@dcc-bs:registry=https://npm.pkg.github.com

Create a github personal access token (classic) with read:packages permissions and add it to your .env file:

GITHUB_TOKEN='YOUR_TOKEN'

Install the module to your Nuxt application with:

bun x nuxi module add @dcc-bs/logger.bs.js

That's it! You can now use logger.bs.js in your Nuxt app ✨

Usage

You can get the logger over the composable useLogger:

const logger = useLogger();

logger.infor('log a info message');
logger.warn('log a warn message');
logger.error('log a error');

On the api side you can get the logger with the util function getEventLogger:

export default defineEventHandler(async (event) => {
    const logger = getEventLogger(event);
    logger.info('log messages');
});

when the module is installed all failed request will be logged as an error.

Release a new Version

Commit your changes and then:

bun release

About

Default logger for all nuxt projects.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors