-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Conversation
Codecov ReportBase: 85.81% // Head: 85.64% // Decreases project coverage by
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
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. |
529e057
to
7389e3e
Compare
The NullConnectionTracer can be embedded, to make it easier to access just a few of the calls.
7389e3e
to
48779d0
Compare
logging/null_tracer.go
Outdated
NullTracer Tracer = &nullTracer{} | ||
// The NullConnectionTracer is a ConnectionTracer that does nothing. | ||
// It is useful for embedding. Don't modify this variable! | ||
NullConnectionTracer ConnectionTracer = &nullConnectionTracer{} |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
ce937b1
to
cd87a64
Compare
Merging, since this needs to go into the next release. |
The
NullTracer
and theNullConnectionTracer
can be embedded, to make it easier to access just a few of the calls.