Skip to content

proposal: x/net: Accept client-provided logger for http2 debug logs in addition to GODEBUG=http2debug=1,2 #52734

@zachwalton

Description

@zachwalton

This allows me to get HTTP/2 debug logs: https://github.com/golang/net/blob/290c469a71a567d354e4abd335577aba44c4bde4/http2/http2.go#L41-L50

...But unlike the gRPC package, I can't specify my own logger. I also can't change the log level at runtime (I can toggle VerboseLogs since that's exported, but not logFrameWrites and logFrameReads).

For logging format consistency and runtime configuration of log levels it would be great to provide my own logger. I suppose this would also require a switch to level-based logging instead of e.g. log.Printf(); I don't know if the structure of logs is covered by the Go compatibility guarantee and if so this would need to be done in a way that doesn't break it (maybe all debug level with no formatting change in the default logger implementation?)

Thanks for considering this!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Hold

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions