wasabi
wasabi copied to clipboard
Print to stderr instead of stdout
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 :)
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.
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.)
I don't mind stdout being default 👌🏻, but having a way to customize it would be nice.