Commit 554ed374 authored by Anna Henningsen's avatar Anna Henningsen Committed by James M Snell
Browse files

Revert "util: change util.inspect depth default"

This reverts commit b994b8ef.

This caused regressions in ecosystem code. While the change originally
was semver-major and could be postponed until after Node.js 10,
I think reverting it is a good choice at this point.

Also, I personally do not think defaulting to a shallow inspect
is a bad thing at all – quite the opposite: It makes `util.inspect()`
give an overview of an object, rather than providing a full
display of its contents. Changing the `depth` default to infinity
fundamentally changed the role that `util.inspect()` plays,
and makes output much more verbose and thus at times unusable
for `console.log()`-style debugging.

Fixes: https://github.com/nodejs/node/issues/19405
Refs: https://github.com/nodejs/node/pull/17907

PR-URL: https://github.com/nodejs/node/pull/20089


Reviewed-By: default avatarJoyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: default avatarAnna Henningsen <anna@addaleax.net>
Reviewed-By: default avatarColin Ihrig <cjihrig@gmail.com>
Reviewed-By: default avatarGus Caplan <me@gus.host>
parent 47af0a0e
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment