Skip to content
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

Added LogMessageGenerator overloads for exceptions #2051

Merged
merged 4 commits into from Apr 9, 2017
Merged

Added LogMessageGenerator overloads for exceptions #2051

merged 4 commits into from Apr 9, 2017

Conversation

c0shea
Copy link
Contributor

@c0shea c0shea commented Apr 4, 2017

Added support for deferred message generation on method overloads that also support Exceptions. See #2014

@codecov-io
Copy link

codecov-io commented Apr 4, 2017

Codecov Report

Merging #2051 into master will increase coverage by <1%.
The diff coverage is 58%.

@@           Coverage Diff           @@
##           master   #2051    +/-   ##
=======================================
+ Coverage      81%     81%   +<1%     
=======================================
  Files         288     289     +1     
  Lines       19840   19900    +60     
  Branches     2339    2352    +13     
=======================================
+ Hits        16135   16187    +52     
- Misses       3109    3119    +10     
+ Partials      596     594     -2

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update bc25298...9c588aa. Read the comment docs.

@304NotModified
Copy link
Member

Thanks!

Unfortunately this isn't backwards-compatible. I think we should write a C# extensions. What do you think?

PS: changes ignoring whitespace changes: https://github.com/NLog/NLog/pull/2051/files?w=1

Copy link
Member

@304NotModified 304NotModified left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Breaking change

@c0shea
Copy link
Contributor Author

c0shea commented Apr 5, 2017

Could you clarify what you mean by it being a breaking change so I know for next time?

I think extensions sound good, though. Do you mean something like this?

@304NotModified
Copy link
Member

Well extending a public interface is a breaking change as other uses who implement that interface have to implement those new methods.

(Custom) Code written to NLog 4.x, should always work for every NLog 4.y (where y>=x) version (we are taking semver very serious)

@304NotModified
Copy link
Member

@c0shea
Copy link
Contributor Author

c0shea commented Apr 5, 2017

Thanks for the link! That list makes a lot of sense. How should I back out these breaking changes in order to add the extension methods?

@304NotModified
Copy link
Member

Well you could add methods to the interface by using c# extensions. That won't break anything :)

@c0shea
Copy link
Contributor Author

c0shea commented Apr 6, 2017

Thanks for the suggestion. I added a new class for the extension methods. Let me know what you think.

@304NotModified
Copy link
Member

Looks good, but the changes to ILogger needs to be reverted?

What's the problem with the CLScompliant? We prefer CLScompliant code

@c0shea
Copy link
Contributor Author

c0shea commented Apr 7, 2017

Whoops, I forgot to revert the changes to ILogger earlier. They're reverted now.

I couldn't have the extensions be CLS-compliant because the ILogger parameter isn't. Both ILogger-V1.cs and ILoggerBase-V1.cs are decorated with [CLSCompliant(false)] and caused the compile to fail.

@304NotModified 304NotModified added this to the 4.4.6 milestone Apr 9, 2017
@304NotModified
Copy link
Member

Thanks! Merged! Will be in NLog 4.4.6

@304NotModified 304NotModified merged commit e843c22 into NLog:master Apr 9, 2017
@304NotModified
Copy link
Member

FYI,

NLog 4.4.6 is live!

https://www.nuget.org/packages/NLog/4.4.6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants