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

Print to stderr instead of stdout #34

Open
kytta opened this issue Jan 17, 2023 · 3 comments
Open

Print to stderr instead of stdout #34

kytta opened this issue Jan 17, 2023 · 3 comments

Comments

@kytta
Copy link

kytta commented Jan 17, 2023

As of now, wasabi just calls print(), which by default prints to the stdout. In my opinion, this is wrong, as stdout (in the Unix ideology) should be used to output the result of the program (for eventual piping), while stderr should be used for warnings and errors.

I propose adding a "stream" parameter to Printer.__init__(), which by default should be set to sys.stderr. You can then use it inside the print() call.

If you're low on free time, I can implement this, too :)

@honnibal
Copy link
Member

honnibal commented Jan 17, 2023

Yes I've been asking for this internally as well :)

I wouldn't rush off to do it, as it's more about deciding the specifics of how it should work.

@adrianeboyd
Copy link
Contributor

My feeling is that it's fine to make it more configurable, but for our current use of wasabi it makes sense for the default to stay stdout. In many cases, the warnings and errors from wasabi are the actual output. (Whether you could argue that some of the current warnings in CLI commands could be python warnings instead is a separate issue.)

@kytta
Copy link
Author

kytta commented Jan 18, 2023

I don't mind stdout being default 👌🏻, but having a way to customize it would be nice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants