Use util.inspect to log in node - fixes #1661
This commit is contained in:
parent
fad8a7286b
commit
7f2ff03ecf
1 changed files with 1 additions and 0 deletions
|
|
@ -222,6 +222,7 @@ module.exports = new function init(name) {
|
||||||
results.push(result)
|
results.push(result)
|
||||||
}
|
}
|
||||||
function serialize(value) {
|
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)
|
if (value === null || (typeof value === "object" && !(value instanceof Array)) || typeof value === "number") return String(value)
|
||||||
else if (typeof value === "function") return value.name || "<anonymous function>"
|
else if (typeof value === "function") return value.name || "<anonymous function>"
|
||||||
try {return JSON.stringify(value)} catch (e) {return String(value)}
|
try {return JSON.stringify(value)} catch (e) {return String(value)}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue