Skip to content

Missing documentation for process.traceProcessWarnings #53514

Open
@BourgoisMickael

Description

@BourgoisMickael

Affected URL(s)

From https://nodejs.org/docs/latest/api/process.html
To https://nodejs.org/docs/latest-v6.x/api/process.html

Description of the problem

I wanted to set --trace-warnings programmaticaly at runtime from within node.

I noticed:

const trace = process.traceProcessWarnings ||
(isDeprecation && process.traceDeprecation);

So I can use process.traceProcessWarnings = true at runtime to toggle stack trace on warnings.

Important

However in the documentation, from version 6.X LTS to latest 22.X, this field process.traceProcessWarnings is never documented but the field process.traceDeprecation is documented (https://nodejs.org/docs/latest/api/process.html#processtracedeprecation).

Btw, the documentation for the fields process.traceDeprecation, process.noDeprecation could mention that they are mutable, just like process.throwDeprecation does since 12.X LTS:

process.throwDeprecation is mutable, so whether or not deprecation warnings result in errors may be altered at runtime.

https://nodejs.org/docs/latest-v12.x/api/process.html#process_process_throwdeprecation
By #29495

It could be nice to document that.

Note

Also I noticed the process.noProcessWarnings does not work like process.noDeprecation:
it won't change the behavior if assigned at runtime. For this case, using the --no-warnings is the only option.
And I don't know why as this is not documented

Should I make a PR to add documentation

Metadata

Metadata

Assignees

No one assigned

    Labels

    docIssues and PRs related to the documentations.processIssues and PRs related to the process subsystem.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions