import winston from "winston";
const customLevels = {
  levels: {
    error: 0,
    warn: 1,
    info: 2,
    sql: 3,
    debug: 4,
  },
  colors: {
    error: "red",
    warn: "yellow",
    info: "green",
    sql: "magenta",
    debug: "blue",
  },
};
winston.addColors(customLevels.colors);

export const logger = winston.createLogger({
  levels: customLevels.levels,
  format: winston.format.json(),
  transports: [
    new winston.transports.File({ filename: "db_queries.log", level: "sql" }),
    new winston.transports.File({ filename: "errors.log", level: "error" }),
  ],
});
