Last active
December 19, 2015 13:29
-
-
Save seanmonstar/5962468 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
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