From ac7450a09a4c167cd43c14d7c88721d22f077529 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 The current default is not ideal in most use cases. Therefore it is changed to inspect objects to a maximum depth of 20 in case util.inspect is called with it's defaults. The default is kept at 2 when using console.log() and similar in the repl. PR-URL: https://github.com/nodejs/node/pull/17907 Refs: https://github.com/nodejs/node/issues/12693 PR-URL: https://github.com/nodejs/node/pull/22846 Reviewed-By: Matteo Collina Reviewed-By: James M Snell Reviewed-By: Denys Otrishko Reviewed-By: Roman Reiss --- doc/api/util.md | 24 +++++++++++++---- lib/internal/util/inspect.js | 2 +- lib/repl.js | 5 ++-- test/parallel/test-stream-buffer-list.js | 8 ++++++ test/parallel/test-util-inspect-proxy.js | 16 ++++++----- test/parallel/test-util-inspect.js | 34 +++++++++++++++--------- 6 files changed, 62 insertions(+), 27 deletions(-) diff --git a/doc/api/util.md b/doc/api/util.md index 29ba65b760346e..00604813c3a9ed 100644 --- a/doc/api/util.md +++ b/doc/api/util.md @@ -360,6 +360,9 @@ stream.write('With ES6');