Scaffold TypeScript project and add core logger

This commit is contained in:
2026-08-12 20:50:40 +02:00
parent abfbc1e2da
commit a9a8fa7c3f
9 changed files with 3116 additions and 0 deletions

View File

@@ -0,0 +1,12 @@
import pino from 'pino';
export type Logger = pino.Logger;
export function createLogger(name: string): Logger {
const isProduction = process.env.NODE_ENV === 'production';
return pino({
name,
level: process.env.LOG_LEVEL ?? 'info',
transport: isProduction ? undefined : { target: 'pino-pretty' },
});
}