Created
March 26, 2019 10:12
-
-
Save androidfanatic/a6951757022eafd30650cf5f4251b398 to your computer and use it in GitHub Desktop.
Simple winston logger
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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