Skip to content

Commit

Permalink
Merge pull request #5 from jplatte/patch-1
Browse files Browse the repository at this point in the history
Use util.inspect with depth: null for traceAny on node.js
  • Loading branch information
garyb committed May 4, 2016
2 parents 00636b8 + c997947 commit 7752b8d
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/Debug/Trace.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
/* global exports, console */
/* global exports, console, require */
"use strict";

// module Debug.Trace

exports.traceAny = function (x) {
return function (k) {
console.log(x);
// node only recurses two levels into an object before printing
// "[object]" for further objects when using console.log()
if (require !== undefined) {
var util = require("util");
console.log(util.inspect(x, { depth: null, colors: true }));
} else {
console.log(x);
}

return k({});
};
};

0 comments on commit 7752b8d

Please sign in to comment.