Skip to content

Changing default options for util.inspect #7566

Description

@silverwind

console.log and relatives use util.inspect to stringify complex structures, which creates somewhat of a dilemma when you have an application making use of bare console functions but you'd like unrestricted nesting (depth: null) or more than 100 visible array elements ( maxArrayLength: null) by default.

To change the default, I could see util.inspect.setup(opts) being made available. Anyone with me?

Activity

  1. added
    utilIssues and PRs related to the built-in util module.
    feature requestIssues requesting new Node.js features.
    consoleIssues and PRs related to the console subsystem.
    on Jul 6, 2016
  2. mscdex commented on Jul 6, 2016

    @mscdex
    Contributor

    I think at that point, you should just consider using your own logging function everywhere.

  3. jasnell commented on Aug 5, 2016

    @jasnell
    Member

    Having some mechanism by which to modify the defaults here makes sense, but I'm not sure we could get consensus around it. An alternate logging function (or monkeypatch for console) would likely be the most productive approach.

  4. silverwind commented on Aug 8, 2016

    @silverwind
    ContributorAuthor

    Let's see how it goes. Filed #8013.

  5. added a commit that references this issue on Aug 9, 2016
  6. added a commit that references this issue on Aug 9, 2016
  7. added a commit that references this issue on Aug 10, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    consoleIssues and PRs related to the console subsystem.feature requestIssues requesting new Node.js features.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