Skip to content

Instantly share code, notes, and snippets.

@AllGistsEqual
Created February 15, 2021 12:40
Show Gist options
  • Save AllGistsEqual/0ab4355340a31656bf41686ed72b0692 to your computer and use it in GitHub Desktop.
Save AllGistsEqual/0ab4355340a31656bf41686ed72b0692 to your computer and use it in GitHub Desktop.
// File: src/index.js
const logger = tag =>
winston.createLogger({
levels: logLevels,
transports: [new winston.transports.Console({ colorize: true, timestamp: true })],
format: winston.format.combine(
winston.format.colorize(),
winston.format.padLevels({ levels: logLevels }),
winston.format.timestamp(),
winston.format.printf(info => `${info.timestamp} ${info.level}: ${tag}${info.message}`),
),
level: 'debug',
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment