diff --git a/src/Debug/Trace.js b/src/Debug/Trace.js index b4634f5..00029b0 100644 --- a/src/Debug/Trace.js +++ b/src/Debug/Trace.js @@ -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({}); }; };