Created
May 29, 2014 19:21
-
-
Save wookets/469c57c95f87d81175eb to your computer and use it in GitHub Desktop.
winston log.js wrapper
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
var winston = require('winston'); | |
function getLogger(module) { | |
var path = module.filename.split('/').slice(-2).join('/'); //using filename in log statements | |
return new winston.Logger({ | |
transports : [ | |
new winston.transports.Console({ | |
colorize: true, | |
level: 'debug', | |
label: path | |
}) | |
] | |
}); | |
} | |
module.exports = getLogger; |
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
var log = require('./libs/log')(module); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment