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

add a logging.NullTracer and logging.NullConnectionTracer #3512

Merged
merged 4 commits into from Aug 27, 2022

Conversation

marten-seemann
Copy link
Member

@marten-seemann marten-seemann commented Aug 20, 2022

The NullTracer and the NullConnectionTracer can be embedded, to make it easier to access just a few of the calls.

@codecov
Copy link

codecov bot commented Aug 20, 2022

Codecov Report

Base: 85.81% // Head: 85.64% // Decreases project coverage by -0.17% ⚠️

Coverage data is based on head (cd87a64) compared to base (a901357).
Patch has no changes to coverable lines.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3512      +/-   ##
==========================================
- Coverage   85.81%   85.64%   -0.17%     
==========================================
  Files         134      137       +3     
  Lines        9851    10497     +646     
==========================================
+ Hits         8453     8990     +537     
- Misses       1027     1101      +74     
- Partials      371      406      +35     
Impacted Files Coverage Δ
internal/protocol/connection_id.go 75.00% <0.00%> (-6.82%) ⬇️
config.go 100.00% <0.00%> (ø)
internal/qtls/go118.go 58.33% <0.00%> (ø)
sys_conn_oob.go 71.88% <0.00%> (ø)
sys_conn_df_linux.go 52.94% <0.00%> (ø)
packet_handler_map.go 72.37% <0.00%> (+0.78%) ⬆️
http3/server.go 74.29% <0.00%> (+1.25%) ⬆️
connection.go 79.59% <0.00%> (+1.95%) ⬆️
conn_id_generator.go 92.31% <0.00%> (+2.65%) ⬆️
client.go 82.02% <0.00%> (+3.12%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@marten-seemann marten-seemann force-pushed the null-connection-tracer branch 2 times, most recently from 529e057 to 7389e3e Compare August 22, 2022 10:14
@marten-seemann marten-seemann changed the title add a logging.NullConnectionTracer add a logging.NullTracer and logging.NullConnectionTracer Aug 22, 2022
The NullConnectionTracer can be embedded, to make it easier to access just a
few of the calls.
NullTracer Tracer = &nullTracer{}
// The NullConnectionTracer is a ConnectionTracer that does nothing.
// It is useful for embedding. Don't modify this variable!
NullConnectionTracer ConnectionTracer = &nullConnectionTracer{}
Copy link
Member Author

Choose a reason for hiding this comment

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

Design decision: Should NullConnectionTracer be a variable, or should it be the type?

Advantage variable: There's only a single NullConnectionTracer instance.
Advantage type: makes it really easy to embed, which is not possible when it's a variable.

Copy link
Member Author

Choose a reason for hiding this comment

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

Switched it to a type. This makes embedding easier. I don't think having a single instance is actually a problem.

@marten-seemann
Copy link
Member Author

Merging, since this needs to go into the next release.

@marten-seemann marten-seemann merged commit 07412be into master Aug 27, 2022
@marten-seemann marten-seemann deleted the null-connection-tracer branch August 27, 2022 11:24
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.

None yet

1 participant