-
Notifications
You must be signed in to change notification settings - Fork 36
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
Refactor LogWithNameAttribute #103
Conversation
@@ -38,24 +38,7 @@ public LogWithNameAttribute(string newName) | |||
/// <inheritdoc/> | |||
public bool TryCreateLogEventProperty(string name, object? value, ILogEventPropertyValueFactory propertyValueFactory, [NotNullWhen(true)] out LogEventProperty? property) | |||
{ | |||
var propValue = propertyValueFactory.CreatePropertyValue(value); | |||
|
|||
LogEventPropertyValue? logEventPropVal = propValue switch |
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.
@nblumhardt What was the point to copy objects in that switch block? It looks strange and method should work without it if I have not missed unobvious details. Also I removed logEventPropVal
null-check since propertyValueFactory.CreatePropertyValue
always returns some not null LogEventPropertyValue
.
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.
@paymanx Could you please shed light on what is happening in the code here as an author? What is the reason for re-boxing of values?
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.
Hi guys. Since I did not receive feedback for a month, I merge this and go on with publishing release. If there are errors, then I will release a fix thereafter.
This PR is the last one to increase code coverage to 100%. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #103 +/- ##
===========================================
+ Coverage 96.35% 100.00% +3.64%
===========================================
Files 11 11
Lines 247 234 -13
Branches 36 34 -2
===========================================
- Hits 238 234 -4
+ Misses 7 0 -7
+ Partials 2 0 -2 ☔ View full report in Codecov by Sentry. |
No description provided.