-
Notifications
You must be signed in to change notification settings - Fork 30.3k
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
util.inspect multiline output length limit should be configurable #7305
Comments
It would be great to see a PR that adds a property to the |
This commit adds a breakLength option to util.inspect(). This option allows users to control the length at which object keys are split across multiple lines. For backwards compatibility, this option defaults to 60. Fixes: nodejs#7305 PR-URL: nodejs#7499 Reviewed-By: Evan Lucas <evanlucas@me.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
This commit adds a breakLength option to util.inspect(). This option allows users to control the length at which object keys are split across multiple lines. For backwards compatibility, this option defaults to 60. Fixes: #7305 PR-URL: #7499 Reviewed-By: Evan Lucas <evanlucas@me.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
By setting breakLength to 1, shouldn't this create multiple lines in the output? I'm getting a single line string like this:
|
@whitneyland I get the following output If the documentation is not clear enough about this, could you please open a issue for this? |
Setting |
@windmaomao I just checked and it does work properly for me. Do you have a concrete example that does not work as expected? And what Node.js version do you use? |
@BridgeAR the node version is 14.15.3, but i have tried with couple of different version as well, so it's pretty consistent. Here's how to reproduce it, if you use the following code and then try to set
|
If I understood correct, you prefer to deactivate the array grouping functionality. It's possible to set |
Version: v4.4.5
Platform: Darwin MacBook-Air.local 14.3.0 Darwin Kernel Version 14.3.0: Mon Mar 23 11:59:05 PDT 2015; root:xnu-2782.20.48~5/RELEASE_X86_64 x86_64
Subsystem: util : util.js#L815:
The limit is 60 . Can this be configurable ?
Or is there any potentially foolproof way to log any type of variables in a single line for logging purposes.
P.S> would be happy to submit PR in desired format if this is is acknowledged.
The text was updated successfully, but these errors were encountered: