-
-
Notifications
You must be signed in to change notification settings - Fork 503
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
Suppress the unnecessary “unsupported options notice” #2349
Suppress the unnecessary “unsupported options notice” #2349
Conversation
4e60762
to
f71019f
Compare
In `Scope#update_from_options()`, the method strips key-value pairs from the `options` according to its parameters. When all keys in `options` are supported, it still logs an “unsupported options notice” for an empty `unsupported_option_keys` value with empty array literal in `Sentry::Hub#capture_event`, like: "Options [] are not supported and will not be applied to the event." Example: When calling `subject.capture_event(event, level: 'DEBUG')`, the `capture_event` method should handle the options like this: # In this case, options == {:level=>'DEBUG'} unsupported_option_keys = scope.update_from_options(**options) # unsupported_option_keys should be [], but the following debug log will be shown # like "Options [] are not supported and will not be applied to the event." configuration.log_debug <<~MSG Options #{unsupported_option_keys} are not supported and will not be applied to the event. You may want to set them under the `extra` option. MSG This patch changes the logic to check whether `unsupported_option_keys` is empty before logging the notice, thus suppressing unnecessary logs. Signed-off-by: moznion <moznion@mail.moznion.net>
f71019f
to
e549293
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2349 +/- ##
===========================================
- Coverage 98.66% 78.25% -20.41%
===========================================
Files 205 146 -59
Lines 13483 6889 -6594
===========================================
- Hits 13303 5391 -7912
- Misses 180 1498 +1318
|
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.
Thanks for the fix 👍
A related change was introduced in #2303.
Description
In
Scope#update_from_options()
, the method strips key-value pairs from theoptions
according to its parameters. When all keys inoptions
are supported, it still logs an “unsupported options notice” for an emptyunsupported_option_keys
value with empty array literal inSentry::Hub#capture_event
, like: "Options [] are not supported and will not be applied to the event."Example:
When calling
subject.capture_event(event, level: 'DEBUG')
, thecapture_event
method should handle the options like this:This patch changes the logic to check whether
unsupported_option_keys
is empty before logging the notice, thus suppressing unnecessary logs.