feat(shared): reorder AppError constructor to (message, code, status), add singleton logger, retry and TTL cache utilities

This commit is contained in:
MythEclipse
2026-06-02 21:06:42 +07:00
parent 9045e7e347
commit 2d79d8aefd
50 changed files with 401 additions and 449 deletions
@@ -1,24 +0,0 @@
import pino from "pino";
import { config } from "../config/index.js";
const isDev = config.NODE_ENV === "development";
export const logger = pino({
level: config.LOG_LEVEL,
transport: isDev
? {
target: "pino-pretty",
options: {
colorize: true,
translateTime: "SYS:standard",
ignore: "pid,hostname",
},
}
: undefined,
});
export function createChildLogger(context: string) {
return logger.child({ context });
}
export type Logger = ReturnType<typeof createChildLogger>;