mirror of
https://github.com/lux-tel/websites.git
synced 2026-10-30 20:31:36 +00:00
23 lines
492 B
TypeScript
23 lines
492 B
TypeScript
import { pino } from 'pino';
|
|
|
|
// biome-ignore lint: correctness noUnusedVariables: TODO: change this to use the json logger properly
|
|
export function constructLoggingArgs(...data: Array<any>) {
|
|
if (data && typeof data[0] === 'object') {
|
|
return data[0];
|
|
}
|
|
return [data?.join(' ')];
|
|
}
|
|
|
|
export const initLogger = () => {
|
|
return pino({
|
|
transport: {
|
|
target: 'pino-pretty',
|
|
options: {
|
|
colorize: true,
|
|
},
|
|
},
|
|
});
|
|
};
|
|
|
|
export const logger = initLogger();
|