-
-
Save carlosvillu/ddd80098e196ebc084ae to your computer and use it in GitHub Desktop.
Better console.log in Node
This file contains hidden or 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
// UPD: | |
// Now available as npm module! | |
// Check out https://github.com/RReverser/better-log for details. | |
console.log = (function (log, inspect) { | |
return function () { | |
return log.apply(this, Array.prototype.map.call(arguments, function (arg) { | |
return inspect(arg, { depth: 1, colors: true }); | |
})); | |
}; | |
})(console.log, require("util").inspect); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment