Skip to content
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

Missing documentation for process.traceProcessWarnings #53514

Open
BourgoisMickael opened this issue Jun 19, 2024 · 2 comments · May be fixed by #53641
Open

Missing documentation for process.traceProcessWarnings #53514

BourgoisMickael opened this issue Jun 19, 2024 · 2 comments · May be fixed by #53641
Labels
doc Issues and PRs related to the documentations. process Issues and PRs related to the process subsystem.

Comments

@BourgoisMickael
Copy link

BourgoisMickael commented Jun 19, 2024

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

@BourgoisMickael BourgoisMickael added the doc Issues and PRs related to the documentations. label Jun 19, 2024
@RedYetiDev
Copy link
Member

If you make a PR modifying the docs, the project will be happy to review it :-)

@VoltrexKeyva VoltrexKeyva added the process Issues and PRs related to the process subsystem. label Jun 20, 2024
@benjamingr
Copy link
Member

Huh, I don't remember, it seems like it's there from the start - @jasnell any idea?

AlirezaEbrahimkhani added a commit to AlirezaEbrahimkhani/node that referenced this issue Jun 29, 2024
Add documentation for the `process.traceProcessWarnings`
property in the process module. This property allows for programmatic
control of warning trace settings in Node.js applications and was previously
undocumented despite being available since Node.js v6.x.

resolves nodejs#53514
AlirezaEbrahimkhani added a commit to AlirezaEbrahimkhani/node that referenced this issue Jun 30, 2024
AlirezaEbrahimkhani added a commit to AlirezaEbrahimkhani/node that referenced this issue Jul 4, 2024
AlirezaEbrahimkhani added a commit to AlirezaEbrahimkhani/node that referenced this issue Jul 4, 2024
AlirezaEbrahimkhani added a commit to AlirezaEbrahimkhani/node that referenced this issue Jul 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
doc Issues and PRs related to the documentations. process Issues and PRs related to the process subsystem.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants