import path from"node:path";import winston from"winston";import"winston-daily-rotate-file";export const Logger=winston.Logger;export const LogEntry=winston.LogEntry;export function createLogger(e,o,t){const{createLogger:r,format:n,transports:i}=winston,s=t.logsize||"10m",a=Number(t.maxlogs)||5,l=r({level:"debug",format:n.combine(n.timestamp({format:"YYYY-MM-DD HH:mm:ss"}),n.errors({stack:!0}),n.json()),transports:[new i.DailyRotateFile({filename:path.join(e.logs,"debug"),extension:".log",maxSize:s,maxFiles:a}),new i.DailyRotateFile({filename:path.join(e.logs,"error"),extension:".log",level:"error",maxSize:s,maxFiles:a}),new i.Console({format:n.combine(n.colorize(),n.printf((e=>{let o=`${vtt} | ${e.timestamp} | [${e.level}] ${e.message}`;return e.stack&&(o+="\n"+e.stack),o})))})]});for(let e of o)l.log(e);return l}