'use strict'; const winston = require('winston'); const args = require('./cli.js')(); const logger = winston.createLogger({ level: args.logLevel, transports: [ new winston.transports.Console({ level: args.logLevel, format: winston.format.combine( winston.format.timestamp({ format: 'YYYY-MM-DD HH:mm:ss' }), winston.format.colorize(), winston.format.printf(info => `${info.timestamp} ${info.level}: ${info.message}`), ), timestamp: true, }), ], }); function getLogger() { return logger; } module.exports = getLogger;