Skip to content

Instantly share code, notes, and snippets.

@seanmonstar
Last active December 19, 2015 13:29
Show Gist options
  • Save seanmonstar/5962468 to your computer and use it in GitHub Desktop.
Save seanmonstar/5962468 to your computer and use it in GitHub Desktop.
const winston = require('winston');
var logger = new (winston.Logger)({
// transports and whatever loggy stuffs
});
logger.extend(console);
var log = console.log;
console.log = function hijacked_log(level) {
if (arguments.length > 1 && level in this) {
log.apply(this, arguments);
} else {
var args = Array.prototype.slice.call(arguments);
args.unshift('debug');
log.apply(this, args);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment