const winston = require('winston');

const logger = winston.createLogger({
    level: 'info',
    format: winston.format.combine(
      winston.format.timestamp({ format: 'YYYY.MM.DD - HH:mm' }),
      winston.format.printf(({ level, message, timestamp }) => {
        return `${level}: ${message} || ${timestamp}`;
      })
    ),
    transports: [
      new winston.transports.Console(),
      new winston.transports.File({ filename: 'error.log', level: 'error' }),
      new winston.transports.File({ filename: 'combined.log' }),
    ]
  });

module.exports = logger;