{"size": 690, "ext": "js", "max_stars_repo_path": "lib/logger.js", "max_stars_repo_name": "sarosia/lroxy", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "lib/logger.js", "max_issues_repo_name": "sarosia/lroxy", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "lib/logger.js", "max_forks_repo_name": "sarosia/lroxy", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 22.2580645161, "max_line_length": 62, "alphanum_fraction": 0.5869565217}
const {createLogger, format, transports} = require('winston');
require('winston-daily-rotate-file');

const logger = createLogger({
  'level': 'info',
  'format': format.combine(
      format.timestamp({
        'format': 'YYYY-MM-DD HH:mm:ss',
      }),
      format.errors({'stack': true}),
      format.splat(),
      format.json(),
  ),
  'transports': [
    new transports.DailyRotateFile({
      'filename': 'lroxy-%DATE%.log',
      'datePattern': 'YYYY-MM-DD',
      'zippedArchive': false,
      'maxFiles': '7d',
    }),
  ],
});

if (process.env.NODE_ENV !== 'production') {
  logger.add(new transports.Console({
    'format': format.simple(),
  }));
}

module.exports = logger;
