24 lines
457 B
TypeScript
24 lines
457 B
TypeScript
import pino from 'pino';
|
|
import pretty from 'pino-pretty';
|
|
|
|
const consoleLogger = pino(
|
|
pretty({
|
|
colorize: true,
|
|
ignore: 'hostname,pid',
|
|
}),
|
|
);
|
|
|
|
const logger = {
|
|
info: (msg: string, ...args: any[]) => {
|
|
consoleLogger.info(msg, ...args);
|
|
},
|
|
error: (msg: string, ...args: any[]) => {
|
|
consoleLogger.error(msg, ...args);
|
|
},
|
|
warn: (msg: string, ...args: any[]) => {
|
|
consoleLogger.warn(msg, ...args);
|
|
},
|
|
};
|
|
|
|
export { logger };
|