-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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 final param to AddRule
Methods
#2612
Conversation
Add Params ( final ) By AddRule Method
add final param by addrule method
This is a breaking change. You have to make new methods, instead of adding parameter to existing ones. |
@snakefoot I don‘t want to configure nlog by xml file.I want configure nlog by LoggingConfiguration.but the AddRule method don't has 'final' param. why this is a breaking change? |
Your code-change requires a complete recompile of all source-code using NLog, or else they will get a MissingMethodException: Ex. This method is suddenly gone:
Instead there is this method, but it has a different signature:
|
@snakefoot So, Should I open a new issue?? |
@893949088 You can just add more commits to the same PR. They will usually be squashed into a single commit before merge. |
@snakefoot But I don't have more change to commit. I really want this ’final‘ function。 |
@893949088 If you want this included within the next year, then you need to fix the breaking change. Else it will be postponed until like forever. |
@snakefoot I'm very sad. why is the 'LoggingConfiguration' imperfect? |
Because of the breaking change you have introduced, by changing the signature of the existing methods. |
@snakefoot How can I do it to fix the breaking change?I haven't submit PR before. |
@893949088 The breaking change is that you have modified the signature of the existing methods. The very simple solution is not to modify the signature of the existing methods. So just add the new methods without default parameters, and make the existing methods call the new method: public void AddRuleForOneLevel(LogLevel level, Target target, string loggerNamePattern = "*")
{
// Existing method forwarding to new method
AddRuleForOneLevel(level, target, loggerNamePattern, false);
}
public void AddRuleForOneLevel(LogLevel level, Target target, string loggerNamePattern, bool final)
{
// Do the right thing
} |
@snakefoot Thank you very much!!! |
Add AddRule Method (final param)
Codecov Report
@@ Coverage Diff @@
## master #2612 +/- ##
=======================================
+ Coverage 81% 81% +<1%
=======================================
Files 325 325
Lines 23938 23950 +12
Branches 3025 3028 +3
=======================================
+ Hits 19416 19427 +11
- Misses 3704 3708 +4
+ Partials 818 815 -3 |
〒_〒!〒_〒!〒_〒! |
@893949088 Remember to remove the parameter default values for the new methods. |
AddRule
Methods
looks good, thanks! Will merge this when Travis gives green (restarted Travis, it was stuck) |
add final param by AddRule Method