Skip to content

Instantly share code, notes, and snippets.

@androidfanatic
Created March 26, 2019 10:12
Show Gist options
  • Save androidfanatic/a6951757022eafd30650cf5f4251b398 to your computer and use it in GitHub Desktop.
Save androidfanatic/a6951757022eafd30650cf5f4251b398 to your computer and use it in GitHub Desktop.
Simple winston logger
const winston = require('winston');
const logger = winston.createLogger({
level: 'debug',
exitOnError: true,
format: winston.format.combine(
winston.format.colorize(),
winston.format.simple(),
),
transports: [
new winston.transports.Console({
timestamp: true,
}),
],
});
logger.dd = (...args) => {
logger.info(...args);
process.exit(0);
};
module.exports = logger;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment