Skip to content

Instantly share code, notes, and snippets.

@wookets
Created May 29, 2014 19:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wookets/469c57c95f87d81175eb to your computer and use it in GitHub Desktop.
Save wookets/469c57c95f87d81175eb to your computer and use it in GitHub Desktop.
winston log.js wrapper
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;
var log = require('./libs/log')(module);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment