From b994b8eff6018433a56bb10dbc473cefa0dd9370 Mon Sep 17 00:00:00 2001 From: Ruben Bridgewater Date: Thu, 28 Dec 2017 23:40:30 +0100 Subject: [PATCH] util: change util.inspect depth default MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The current default is not ideal in most use cases. Therefore it is changed to showing unlimited depth in case util.inspect is called directly. The default is kept as before for console.log and similar. Using console.dir will now show a depth of up to five and console.assert / console.trace will show a unlimited depth. PR-URL: https://github.com/nodejs/node/pull/17907 Refs: https://github.com/nodejs/node/issues/12693 Reviewed-By: James M Snell Reviewed-By: Matteo Collina Reviewed-By: Michaƫl Zasso --- doc/api/util.md | 33 +++++++++++++++++------- lib/repl.js | 5 ++-- lib/util.js | 5 ++-- test/parallel/test-stream-buffer-list.js | 8 ++++++ test/parallel/test-util-inspect-proxy.js | 16 +++++++----- test/parallel/test-util-inspect.js | 26 +++++++++---------- 6 files changed, 60 insertions(+), 33 deletions(-) diff --git a/doc/api/util.md b/doc/api/util.md index a2d3c71bb633a8..ae4cec72e11c7d 100644 --- a/doc/api/util.md +++ b/doc/api/util.md @@ -327,6 +327,9 @@ stream.write('With ES6');