replace logger
All checks were successful
deploy / build-and-deploy (/testvaro, /opt/website-test, website-test) (push) Successful in 27s
deploy / build-and-deploy (/varo, /opt/website, website) (push) Successful in 12s

This commit is contained in:
2025-10-11 15:08:21 +02:00
parent 72c1a6a69c
commit 646659e1d1
5 changed files with 143 additions and 52 deletions

View File

@@ -1,7 +1,7 @@
import { sequence } from 'astro/middleware';
import crypto from 'node:crypto';
import type { MiddlewareHandler } from 'astro';
import { logger } from '@it-astro:logger';
import { logger } from '@util/log.ts';
const actionInternalServerError: MiddlewareHandler = async (context, next) => {
let response = await next();

11
src/util/log.ts Normal file
View File

@@ -0,0 +1,11 @@
import pino from 'pino';
export const logger = pino({
base: null,
level: process.env.LOG_LEVEL || (import.meta.env.DEV ? 'debug' : 'warn'),
formatters: {
level: (label) => {
return { label };
}
}
});