Files
no-twitter-bot/src/logger.ts
Lucid Kobold fa1e07e4af First build
2025-02-19 11:11:47 -05:00

32 lines
661 B
TypeScript

import { config } from "#root/config.js";
import { pino } from "pino";
export const logger = pino({
level: config.logLevel,
transport: {
targets: [
...(config.isDebug
? [
{
target: "pino-pretty",
level: config.logLevel,
options: {
ignore: "pid,hostname",
colorize: true,
translateTime: true
}
}
]
: [
{
target: "pino/file",
level: config.logLevel,
options: {}
}
])
]
}
});
export type Logger = typeof logger;