Consider not writing to stderr or allowing opt-out
See original GitHub issueIt’s a bit surprising to have a library write to stderr as a side effect of invoking it:
Browserslist: caniuse-lite is outdated. Please run next command yarn upgrade caniuse-lite browserslist
Perhaps browserlist
could also accept a callback that it would yield warning messages to.
I definitely understand the reasoning behind these warnings, but tools using browserslist may have their own command line interfaces that would be disrupted by it writing to stderr. In this case it would be best to have the tool decide how to surface this feedback.
If it’s still absolutely necessary to write to stderr, perhaps a default implementation would do so, but if the library was invoked with an onWarn
or similar, it would not.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:3
- Comments:11 (6 by maintainers)
Top Results From Across the Web
Why does Mojo::Server::Daemon debugging print to STDERR?
Setting the MOJO_DAEMON_DEBUG environment variable causes debugging messages to be printed to STDERR. Why does it use STDERR and not STDOUT?
Read more >How do I write standard error to a file while using "tee" with a ...
The prompt is on a blank line letting me think the process is not finished, and when I press Enter this fix it....
Read more >Separate stderr and stdout – IDEs Support (IntelliJ Platform)
I use the logging module for logging error messages and some of my scripts dump their output to stdout. In PyCharm, these get...
Read more >What are stdin, stderr and stdout in Bash - Linux Hint
Essentially, they allow piping/redirecting data from one command to another. Let's check out how stdin, stderr, and stdout works and how you can...
Read more >Revert/Modify "Create Pull Request" message on remote push ...
This is problematic for us because that message is shown in stderr and our build ... Why not write your script to work...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Released in 4.5.4
Thanks for the reply @ai. Our use case is pretty close to what I described: in @parcel-bundler we invoke @babel/preset-env which uses
browserslist
. We have a rich cli interface[1] implemented with @vadimdemedes/ink, which relies on control of stdio. We currently patch console.log to avoid browserlist from writing directly to stderr.[1] https://github.com/parcel-bundler/parcel/blob/v2-work-so-far/packages/reporters/cli/src/CLIReporter.js#L13