text: const winston = require('winston');
  
  const alignedWithColorsAndTime = winston.format.combine(
      winston.format.colorize(),
      winston.format.timestamp(),
      winston.format.align(),
      winston.format.printf((info) => {
          const { timestamp, level, message, ...args } = info;
          const ts = timestamp.slice(0, 19).replace('T', ' ');
          return `${ts} [${level}]: ${message} ${Object.keys(args).length ? JSON.stringify(args, null, 2) : ''}`;
      }),
  );
  
  const logger = winston.createLogger({
      level: 'info',
      format: winston.format.json(),
      transports: [
          new winston.transports.File({ filename: 'error.log', level: 'error' }),
          new winston.transports.File({ filename: 'combined.log' })
      ]
  });
  
  if (process.env.NODE_ENV !== 'production') {
      logger.add(new winston.transports.Console({
          format: alignedWithColorsAndTime
      }));
  }
  
  module.exports = logger;
  