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
proposal: log: wrap testlog.SetLogger() Visible to the public in package log. #40720
Comments
@liu-xuewen could you please describe the problem that you would be able to solve if this proposal were accepted. |
Package testlog provides a back-channel communication path between tests and package os, so that wen can see which environment variables and files a test consults. |
As you say, the testlog is an internal mechanism. We do not want to expose it for general use. If other packages start to use it, that will make it impossible to update the internal mechanism. Can you explain more precisely what it is that you want to do, and why? At the moment I think it is quite unlikely that this proposal would be accepted. |
I want to do more debug log information about the go process net, such as which files are opened, such as methods os.Open(). Thank you. |
If we were going to support more debug logging in the standard library, we would not do it via the internal/testlog mechanism. That has a specific purpose related to test caching. It's not for debug logging. In general debug logging sounds like something that should be implemented as a wrapper around the standard library, not inside the standard library. But it's true that there are exceptions such as the net/http/httptest package. |
I see what you mean, thank you. Maybe net logging can share a set of underlying testlog methods with testing. |
The exact proposal here is unclear. Changing the behavior of internal/testlog would change nothing user-visible. |
This proposal has been added to the active column of the proposals project |
Based on the discussion above, this proposal seems like a likely decline. |
No change in consensus, so declined. |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
The text was updated successfully, but these errors were encountered: