Skip to content

Add maxStringLength option for util.inspect #27042

Closed
@noam3127

Description

Problem
When using util.inspect(), it would be nice to have the ability to truncate string values over a certain length wherever they exist in the object under inspection. This would allow us to avoid logging out entire strings in situations where they can be potentially huge and they add too much space in the logs.

Proposed solution
Add a maxStringLength option to util.inspect, similar to maxArrayLength option that currently exists.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    feature requestIssues that request new features to be added to Node.js.utilIssues and PRs related to the built-in util module.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions