This repository has been archived on 2026-07-27. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
aniwatch-api/src/config/logger.ts
T

26 lines
605 B
TypeScript

import { env } from "./env.js";
import { pino, type LoggerOptions } from "pino";
const loggerOptions: LoggerOptions = {
redact: env.isProduction ? ["hostname"] : [],
level: "info",
transport: env.isDev
? {
target: "pino-pretty",
options: {
colorize: true,
translateTime: "SYS:standard",
},
}
: undefined,
formatters: {
level(label) {
return {
level: label.toUpperCase(),
};
},
},
};
export const log = pino(loggerOptions);