Skip to content
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

http3: use a log/slog Logger for logging #4449

Merged
merged 1 commit into from
Apr 20, 2024
Merged

http3: use a log/slog Logger for logging #4449

merged 1 commit into from
Apr 20, 2024

Conversation

marten-seemann
Copy link
Member

Fixes #4366. Closes #3548.

Copy link

codecov bot commented Apr 19, 2024

Codecov Report

Attention: Patch coverage is 25.53191% with 35 lines in your changes are missing coverage. Please review.

Project coverage is 84.61%. Comparing base (e48e1d4) to head (b69a50a).

Files Patch % Lines
http3/client.go 14.29% 9 Missing and 3 partials ⚠️
http3/server.go 47.06% 7 Missing and 2 partials ⚠️
http3/response_writer.go 11.11% 8 Missing ⚠️
http3/conn.go 0.00% 5 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4449      +/-   ##
==========================================
- Coverage   84.75%   84.61%   -0.14%     
==========================================
  Files         152      152              
  Lines       14371    14377       +6     
==========================================
- Hits        12179    12164      -15     
- Misses       1691     1709      +18     
- Partials      501      504       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

@rfwatson rfwatson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for updating this 🙏

Comment on lines +84 to +86
if c.Logger != nil {
c.Logger.Debug("setting up connection failed", "error", err)
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question: should we always fallback to slog.Default() if no logger is explicitly set?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure. I don't want to spam peoples' logs with debug messages, so I'm inclined to leave it as is far now. That said, I don't think we have a good / consistent logging philosophy at the moment, so I'd be happy to discuss and revise this decision in the future.

@marten-seemann marten-seemann merged commit 9bc7bd8 into master Apr 20, 2024
34 checks passed
@marten-seemann marten-seemann deleted the http3-slog branch April 20, 2024 09:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

http3 server silently panics http3: use the http.Server.ErrorLog if set
2 participants