-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
breaking,log: set stderr as default log output, add .set_output_stream() #23444
base: master
Are you sure you want to change the base?
Conversation
Connected to Huly®: V_0.6-21875 |
Not so sure setting stderr as default is a good idea, since it will be a "breaking change" to the current. If someone has things set up to capture stdout, they "suddenly" won't be capturing anything, any longer. Etc. |
Personally, I think it is a good change, and should be merged. @medvednikov what do you think? |
I know that I would be royally P.O.'d if something changed like this out from under me, if I already had other programs/scripts set up to parse stdout, and it all of a sudden wasn't there. I'd be yelling about how you broke my stuff. |
Is the impact of this change really that big? Stdout is not used as default by loggers in any logging library I know (Go stdlib as relevant example) and command line applications usually always log to stderr to avoid mixing it with useful program output. I think stdout in the V logger was a bug and it's good to fix it before we reach V 1.0 and even wider adoption. |
Change is good. Unannounced change is not. In other words, don't just change the default out from under people. Let them know it is going to change, first, then change it. Just as V has done for other breaking changes that were deprecated first. |
We can add In that way, for people that do depend on the existing behavior, restoring it will be a one line change, and the need for that will be clearly documented/visible, in both the docs and from the commit line. |
That's fine, and it's good documentation to have. Of course, you're still "breaking" them until they either go look up the merge description/commit, or read the new docs. I think it's a good change. Output the logs to stderr. Most things do tend to do that, unless their default is to log to a file. However, having other things break is annoying at best, and catastrophic at worst. Imagine if the default output of |
I agree, but the language/vlib version is still < 1.0, and we do not have a mechanism to mark it more clearly than that, and I also can not think of one, while still keeping the same API and module name. Do you think that we should introduce |
|
To clarify, if someone decided to make a program that behaved like |
I simply used Specifically for Argue all you want about whether it's a good idea to have |
I already agreed that it is a breaking change. However, it is a good breaking change. One way is adding a breaking tag - already done. If you have other ideas about how to make the transition easier, while keeping the same API, go ahead and propose them. |
How about a The notice can be removed after a while, leaving the new default in place. |
A compiler notice, or a runtime one, by the module itself? |
I don't know which would be seen more. :-\ |
This PR is second try of #23296
In short:
io.Writer
via new.set_output_stream()
fnos.stderr()
as default log output.