mirror of
https://github.com/DCC-BS/logger.bs.js.git
synced 2026-08-26 10:24:22 +00:00
Read-only mirror of https://github.com/DCC-BS/logger.bs.js — Basel-Stadt. Issues & pull requests at the source.
- TypeScript 99.2%
- Vue 0.8%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
|
|
||
| .github/workflows | ||
| .vscode | ||
| playground | ||
| src | ||
| test | ||
| .editorconfig | ||
| .gitignore | ||
| .npmignore | ||
| .npmrc | ||
| biome.json | ||
| bun.lock | ||
| CHANGELOG.md | ||
| codecov.yml | ||
| LICENSE | ||
| package.json | ||
| README.md | ||
| renovate.json | ||
| tsconfig.json | ||
| vitest.config.ts | ||
logger.bs.js
Important
This project is deprecated use Nuxt-Layers instead.
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