有什么方法可以在Go中启用对http2请求和响应的详细跟踪?

Is there any way to enable detailed tracing of http2 requests and responses in GO?

I would like to be able to log connection attempts, timeouts, and transmission of requests so that I can diagnose production problems after the fact.

Stracing is fine during development, but it not useful for determining the details of problems after they occur.

Thank you

You can set the GODEBUG=http2debug=1 or GODEBUG=http2debug=2 environment variable.

Example:

 env GODEBUG=http2debug=2 go run something.go

source: http://tip.golang.org/pkg/net/http/