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

Suppress specific warnings #40940

Closed
MattIPv4 opened this issue Nov 23, 2021 · 16 comments · Fixed by #50661
Closed

Suppress specific warnings #40940

MattIPv4 opened this issue Nov 23, 2021 · 16 comments · Fixed by #50661
Labels
deprecations Issues and PRs related to deprecations. feature request Issues that request new features to be added to Node.js.

Comments

@MattIPv4
Copy link
Member

MattIPv4 commented Nov 23, 2021

Is your feature request related to a problem? Please describe.

We're currently using restify for some projects, and it relies on some deprecated functionality in Node (we don't use the bits that are deprecated, but they're still loaded). There is an issue on their side of the situation to remove the deprecated usage.

However, this results in a large number of deprecation notices in our logs that are noise, as we know about the deprecation and are aware that it doesn't impact what we're doing. We have the option to suppress all deprecation warnings with --no-deprecation, but this could cause us to miss other deprecations down the road.

Describe the solution you'd like

It'd be great if there was a way to only suppress specific warnings. Something as simple as --no-warnings=DEP0111

(Edit: This was originally suggested as --ignore-deprecation, but per 1, 2 & 3 I agree it makes sense to have a generic flag for all warnings)

Describe alternatives you've considered

There is the option to suppress all deprecation warnings with --no-deprecation, but as mentioned this could lead to us missing other deprecations that do impact us.

@MattIPv4 MattIPv4 changed the title Supress specific deprecation warnings Suppress specific deprecation warnings Nov 23, 2021
@targos targos added deprecations Issues and PRs related to deprecations. feature request Issues that request new features to be added to Node.js. labels Nov 23, 2021
@tniessen
Copy link
Member

There are a few related discussions, see #36137, #31000, #40587.

@jasnell
Copy link
Member

jasnell commented Nov 23, 2021

I've said before, I'm +1 on this. I would extend it off the existing command line flag, e.g. --no-warnings=DEP0111. This makes it generic to all types of warnings that have codes assigned.

@github-actions
Copy link
Contributor

There has been no activity on this feature request for 5 months and it is unlikely to be implemented. It will be closed 6 months after the last non-automated comment.

For more information on how the project manages feature requests, please consult the feature request management document.

@github-actions github-actions bot added the stale label May 23, 2022
@targos targos moved this from Pending Triage to Stale in Node.js feature requests May 23, 2022
@MattIPv4
Copy link
Member Author

Would still love to see this implemented, esp. given the related work linked above that goes in a similar direction 💙

@github-actions github-actions bot removed the stale label May 24, 2022
@mcollina
Copy link
Member

mcollina commented Jun 1, 2022

I'm +1 on this.

@jwarkentin
Copy link

Seeing as #31000 was just closed in favor of this, it would be good to update the description to include experimental warnings. I don't know if they're implemented separately from deprecation warnings or not, but I'd hate to see this resolved only to leave #31000 completely unresolved with no issue tracking it.

@alexpetros
Copy link

I came to this issue after following #31000 and it seems like there's a little bit of consensus on a flag that suppresses warnings by code. Would it be appropriate to a new issue that fully describes a generalized version of the flag, that could subsume this issue (and the ones linked above)?

@usrtax
Copy link

usrtax commented Aug 6, 2022

any update ?

@MattIPv4 MattIPv4 changed the title Suppress specific deprecation warnings Suppress specific warnings Aug 8, 2022
@MattIPv4
Copy link
Member Author

MattIPv4 commented Aug 8, 2022

👀 Updated the title/desc to capture suppressing all warning types, not just deprecations 👍

@rauschma
Copy link

My use case is this: I’m importing JSON from an ESM module in a CLI app. Seeing a warning every time I do that, messes up the user interface of the app.

@FrontHorn
Copy link

I would also like to have the ability to suppress a specific warning. We interact with a number of APIs that require the NODE_TLS_REJECT_UNAUTHORIZED to be set to 0. We switch the variable back to 1 as soon as the associated call is returned but the logs are filled with warning noise.

@tniessen
Copy link
Member

I would also like to have the ability to suppress a specific warning. We interact with a number of APIs that require the NODE_TLS_REJECT_UNAUTHORIZED to be set to 0. We switch the variable back to 1 as soon as the associated call is returned but the logs are filled with warning noise.

Side note: it might be a good idea to use the rejectUnauthorized option instead (or to implement proper verification).

@github-actions
Copy link
Contributor

There has been no activity on this feature request for 5 months and it is unlikely to be implemented. It will be closed 6 months after the last non-automated comment.

For more information on how the project manages feature requests, please consult the feature request management document.

@github-actions github-actions bot added the stale label Feb 22, 2023
@FrontHorn
Copy link

I would also like to have the ability to suppress a specific warning. We interact with a number of APIs that require the NODE_TLS_REJECT_UNAUTHORIZED to be set to 0. We switch the variable back to 1 as soon as the associated call is returned but the logs are filled with warning noise.

Side note: it might be a good idea to use the rejectUnauthorized option instead (or to implement proper verification).

Whilst I agree with the implementation of proper verification, there are other components at play that we do not have the ability to change, a lot of them legacy & no longer maintained. Whilst switching the flag from 1 to 0 and back again may not be the best method, in the cases where we do this, it is the only option that works.

@github-actions github-actions bot removed the stale label Feb 23, 2023
@targos targos moved this from Stale to Pending Triage in Node.js feature requests Apr 4, 2023
@DakotaLarson
Copy link

My use case is this: I’m importing JSON from an ESM module in a CLI app. Seeing a warning every time I do that, messes up the user interface of the app.

Adding a +1 as my use case is very similar. Having to use --no-warnings feels like I am accepting more risk than necessary to leverage one experimental feature.

@sebagr
Copy link

sebagr commented Aug 8, 2023

Yup, disabling all warning just to silence one doesn't seem right. +1

nodejs-github-bot pushed a commit that referenced this issue Nov 21, 2023
Co-authored-by: Geoffrey Booth <webadmin@geoffreybooth.com>
Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
PR-URL: #50661
Fixes: #30810
Fixes: #47478
Fixes: #46862
Fixes: #40940
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Vinícius Lourenço Claro Cardoso <contact@viniciusl.com.br>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
targos pushed a commit that referenced this issue Nov 23, 2023
Co-authored-by: Geoffrey Booth <webadmin@geoffreybooth.com>
Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
PR-URL: #50661
Fixes: #30810
Fixes: #47478
Fixes: #46862
Fixes: #40940
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Vinícius Lourenço Claro Cardoso <contact@viniciusl.com.br>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
martenrichter pushed a commit to martenrichter/node that referenced this issue Nov 26, 2023
Co-authored-by: Geoffrey Booth <webadmin@geoffreybooth.com>
Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
PR-URL: nodejs#50661
Fixes: nodejs#30810
Fixes: nodejs#47478
Fixes: nodejs#46862
Fixes: nodejs#40940
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Vinícius Lourenço Claro Cardoso <contact@viniciusl.com.br>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
lucshi pushed a commit to lucshi/node that referenced this issue Nov 27, 2023
Co-authored-by: Geoffrey Booth <webadmin@geoffreybooth.com>
Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
PR-URL: nodejs#50661
Fixes: nodejs#30810
Fixes: nodejs#47478
Fixes: nodejs#46862
Fixes: nodejs#40940
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Vinícius Lourenço Claro Cardoso <contact@viniciusl.com.br>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
RafaelGSS pushed a commit that referenced this issue Nov 29, 2023
Co-authored-by: Geoffrey Booth <webadmin@geoffreybooth.com>
Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
PR-URL: #50661
Fixes: #30810
Fixes: #47478
Fixes: #46862
Fixes: #40940
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Vinícius Lourenço Claro Cardoso <contact@viniciusl.com.br>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
RafaelGSS pushed a commit that referenced this issue Nov 30, 2023
Co-authored-by: Geoffrey Booth <webadmin@geoffreybooth.com>
Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
PR-URL: #50661
Fixes: #30810
Fixes: #47478
Fixes: #46862
Fixes: #40940
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Vinícius Lourenço Claro Cardoso <contact@viniciusl.com.br>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
UlisesGascon pushed a commit that referenced this issue Dec 11, 2023
Co-authored-by: Geoffrey Booth <webadmin@geoffreybooth.com>
Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
PR-URL: #50661
Fixes: #30810
Fixes: #47478
Fixes: #46862
Fixes: #40940
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Vinícius Lourenço Claro Cardoso <contact@viniciusl.com.br>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
UlisesGascon pushed a commit that referenced this issue Dec 15, 2023
Co-authored-by: Geoffrey Booth <webadmin@geoffreybooth.com>
Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
PR-URL: #50661
Fixes: #30810
Fixes: #47478
Fixes: #46862
Fixes: #40940
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Vinícius Lourenço Claro Cardoso <contact@viniciusl.com.br>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
UlisesGascon pushed a commit that referenced this issue Dec 19, 2023
Co-authored-by: Geoffrey Booth <webadmin@geoffreybooth.com>
Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
PR-URL: #50661
Fixes: #30810
Fixes: #47478
Fixes: #46862
Fixes: #40940
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Vinícius Lourenço Claro Cardoso <contact@viniciusl.com.br>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
@RedYetiDev RedYetiDev moved this from Awaiting Triage to Done in Node.js feature requests Jun 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deprecations Issues and PRs related to deprecations. feature request Issues that request new features to be added to Node.js.
Projects
None yet
Development

Successfully merging a pull request may close this issue.