-
Notifications
You must be signed in to change notification settings - Fork 18k
net/http/httputil: ReverseProxy.ErrorLog should accept an interface #21082
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
Comments
Backwards compatibility can't be broken, so marking as Go2. |
mvdan: But if we use an interface that log.Logger matches, in theory it should not break anything, right ? |
Possibly breaking compatibility.
makeLogger may have return typed |
If the signature changes, that breaks the Go1 compatibility promise. @mattn showed the outline of a reasonable program that would break. |
could we do something similar to how e.g., go/src/net/http/httputil/reverseproxy.go Line 325 in 5ea2360
edit: currently have an issue with this, proposed solution for us is likely to be duplicating reverseproxy.go to make the changes we need |
This should be handled as part of #5465. Closing in favor of that issue. |
What version of Go are you using (
go version
)?go version go1.8.3 darwin/amd64
What operating system and processor architecture are you using (
go env
)?GOARCH="amd64"
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
What did you do?
Tried to use a custom logger on ReverseProxy.ErrorLog (like logrus)
What did you expect to see?
A program compiling fine and logging going through my logger from logrus
What did you see instead?
Compilation failed as ReverseProxy.ErrorLog has to be bound to a log.Logger.
ReverseProxy.ErrorLog should accept an interface instead, to allow using any compliant logging system.
Related to : sirupsen/logrus#588
The text was updated successfully, but these errors were encountered: