Skip to content

Instantly share code, notes, and snippets.

@RReverser
Last active May 9, 2019 21:07
Show Gist options
  • Save RReverser/0a7caa89b465d1ed0c96 to your computer and use it in GitHub Desktop.
Save RReverser/0a7caa89b465d1ed0c96 to your computer and use it in GitHub Desktop.

Revisions

  1. RReverser revised this gist May 22, 2015. 1 changed file with 4 additions and 0 deletions.
    4 changes: 4 additions & 0 deletions better-console-log.js
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,7 @@
    // 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) {
  2. RReverser revised this gist May 22, 2015. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions better-console-log.js
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,7 @@
    console.log = (function (log, inspect) {
    return function () {
    return log.apply(this, Array.prototype.map.call(arguments, function (arg) {
    return require("util").inspect(arg, { depth: 1, colors: true });
    return inspect(arg, { depth: 1, colors: true });
    }));
    };
    })(console.log, util.inspect);
    })(console.log, require("util").inspect);
  3. RReverser renamed this gist May 22, 2015. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  4. RReverser created this gist May 22, 2015.
    7 changes: 7 additions & 0 deletions better-console-log
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,7 @@
    console.log = (function (log, inspect) {
    return function () {
    return log.apply(this, Array.prototype.map.call(arguments, function (arg) {
    return require("util").inspect(arg, { depth: 1, colors: true });
    }));
    };
    })(console.log, util.inspect);