Skip to content

Instantly share code, notes, and snippets.

@carlosvillu
Forked from RReverser/better-console-log.js
Last active September 1, 2015 13:28
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 carlosvillu/ddd80098e196ebc084ae to your computer and use it in GitHub Desktop.
Save carlosvillu/ddd80098e196ebc084ae to your computer and use it in GitHub Desktop.
Better console.log in Node
// 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