replace logger
This commit is contained in:
@@ -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
11
src/util/log.ts
Normal 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 };
|
||||
}
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user