From 7f2ff03ecf7b7fcb61396304da121104a5769fe2 Mon Sep 17 00:00:00 2001 From: Rasmus Porsager Date: Fri, 1 Sep 2017 14:02:58 +0200 Subject: [PATCH] Use util.inspect to log in node - fixes #1661 --- ospec/ospec.js | 1 + 1 file changed, 1 insertion(+) diff --git a/ospec/ospec.js b/ospec/ospec.js index a757543f..147e2dc4 100644 --- a/ospec/ospec.js +++ b/ospec/ospec.js @@ -222,6 +222,7 @@ module.exports = new function init(name) { results.push(result) } function serialize(value) { + if (hasProcess) return require("util").inspect(value) if (value === null || (typeof value === "object" && !(value instanceof Array)) || typeof value === "number") return String(value) else if (typeof value === "function") return value.name || "" try {return JSON.stringify(value)} catch (e) {return String(value)}