Created
September 7, 2019 19:08
-
-
Save ludovicwyffels/83041af3c695c6fb4aa5604c95ac77ec to your computer and use it in GitHub Desktop.
This file contains 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
// log setup | |
import winston from 'winston'; | |
const transports = { | |
console: new winston.transports.Console({ level: 'warn' }), | |
}; | |
const logger = winston.createLogger({ | |
transports: [transports.console, transports.file] | |
}); | |
logger.info('This will not be logged in console transport because warn is set!'); | |
transports.console.level = 'info'; // changed the level | |
logger.info('This will be logged in now!'); | |
export default {logger, transport} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment