-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Use LoggerFactory when interceptors are registered #3355
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
base: master
Are you sure you want to change the base?
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #3355 +/- ##
==========================================
- Coverage 85.02% 84.99% -0.03%
==========================================
Files 80 81 +1
Lines 9534 9584 +50
==========================================
+ Hits 8106 8146 +40
- Misses 1003 1014 +11
+ Partials 425 424 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
5f57502 to
d994454
Compare
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.
Pull request overview
This pull request enhances the interceptor configuration API by adding an options pattern to support configurable LoggerFactory and interceptor-specific options. The primary motivation is to enable NewAPI to pass its LoggerFactory to default interceptors when they are registered.
Key changes:
- Added new
InterceptorOptionsstruct and option functions to configure interceptors - Created
*WithOptionsvariants of existing configuration functions for backward compatibility - Updated
NewAPIto pass LoggerFactory when auto-registering default interceptors
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| interceptor_option.go | New file defining InterceptorOptions and option setter functions |
| interceptor.go | Added WithOptions variants for interceptor configuration, fixed typo "reciver" → "receiver", improved variable naming, added documentation comments |
| api.go | Updated to use RegisterDefaultInterceptorsWithOptions with LoggerFactory |
| interceptor_test.go | Updated test to use new WithOptions API (contains unprofessional comment) |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
JoTurk
left a comment
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.
Wish we could do this without introducing this many public APIs in webrtc, but ig we have to.
interceptor_option.go
Outdated
| ) | ||
|
|
||
| // InterceptorOptions contains options for configuring interceptors. | ||
| type InterceptorOptions struct { |
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.
Does this need to be public?
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.
No, changed
Updated interceptor configuration functions to support options. Added options to configure logger factory and interceptor-specific options. Updated NewAPI to pass LoggerFactory when default interceptors are registered.
d994454 to
acc07d2
Compare
I do not like it too, unfortunately there was no other easy way to inject LoggerFactory. This is another thing to cleanup in the future when webrtc v5 will be released. |
Updated interceptor configuration functions to support options. Added options to configure logger factory and interceptor-specific options. Updated NewAPI to pass LoggerFactory when default interceptors are registered.