mirror of
https://litchi.icu/ngc2207/judge4c.git
synced 2025-05-18 19:56:32 +00:00
chore: add pino and pino-pretty for logging functionality
This commit is contained in:
parent
88229a3057
commit
8dc72f7e29
@ -13,6 +13,8 @@
|
|||||||
"clsx": "^2.1.1",
|
"clsx": "^2.1.1",
|
||||||
"lucide-react": "^0.462.0",
|
"lucide-react": "^0.462.0",
|
||||||
"next": "15.0.3",
|
"next": "15.0.3",
|
||||||
|
"pino": "^9.5.0",
|
||||||
|
"pino-pretty": "^13.0.0",
|
||||||
"react": "19.0.0-rc-66855b96-20241106",
|
"react": "19.0.0-rc-66855b96-20241106",
|
||||||
"react-dom": "19.0.0-rc-66855b96-20241106",
|
"react-dom": "19.0.0-rc-66855b96-20241106",
|
||||||
"tailwind-merge": "^2.5.5",
|
"tailwind-merge": "^2.5.5",
|
||||||
|
16
src/lib/logger.ts
Normal file
16
src/lib/logger.ts
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
import pino, { Logger } from "pino";
|
||||||
|
|
||||||
|
const logger: Logger = pino({
|
||||||
|
level: process.env.PINO_LOG_LEVEL || "info",
|
||||||
|
transport: {
|
||||||
|
target: "pino-pretty",
|
||||||
|
options: {
|
||||||
|
colorize: true,
|
||||||
|
translateTime: "SYS:standard",
|
||||||
|
ignore: "pid,hostname",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
redact: ["password", "secret", "token"],
|
||||||
|
});
|
||||||
|
|
||||||
|
export default logger;
|
Loading…
Reference in New Issue
Block a user