-
Notifications
You must be signed in to change notification settings - Fork 29.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Set inspect.defaultOptions using environment variables #12693
Comments
-1 I can see this easily being a slippery slope for a multitude of other options for other core modules as well. |
-1 from me as well. |
|
Yes, this is what I'm currently using. However, that doesn't work when running projects using tooling (forever, pm2, nodemon, gulp, etc). |
I'd rather do those in a I think we should actually re-evaluate our defaults. I run into |
@deadbeef84 ... we just recently landed the |
Hi, @deadbeef84! Thanks for making the feature request and explaining the use case. It sounds like |
Currently inspecting the BufferList can result a maximum call stack size error. Adding a individual inspect function prevents this. PR-URL: nodejs#17907 Refs: nodejs#12693 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Michaël Zasso <[email protected]>
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: nodejs#17907 Refs: nodejs#12693 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Michaël Zasso <[email protected]>
Since the default for depth is changed to `Infinity` it is logical to change the %o default to the same as well. Using %o with `util.format` will now always print the whole object. PR-URL: nodejs#17907 Refs: nodejs#12693 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Michaël Zasso <[email protected]>
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: nodejs#17907 Refs: nodejs#12693
Since the default for depth is changed to `20` it is logical to change the %o default as well. It will now always use the default depth. PR-URL: nodejs#17907 Refs: nodejs#12693
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: nodejs#17907 Refs: nodejs#12693 PR-URL: nodejs#22846 Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Denys Otrishko <[email protected]> Reviewed-By: Roman Reiss <[email protected]>
Since the default for depth is changed to `20` it is logical to change the %o default as well. It will now always use the default depth. PR-URL: nodejs#17907 Refs: nodejs#12693 PR-URL: nodejs#22846 Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Denys Otrishko <[email protected]> Reviewed-By: Roman Reiss <[email protected]>
I really like the addition of
util.inspect.defaultOptions
, but what would be even nicer would be some way to specify these using environment variables. That way no code changes would have to be made to specify these and on a local development machine one could set their default preference easily.I'm suggesting the following environment variables:
The text was updated successfully, but these errors were encountered: