-
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
NLogTraceListener - Reduce overhead by checking LogLevel #2137
NLogTraceListener - Reduce overhead by checking LogLevel #2137
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2137 +/- ##
=======================================
- Coverage 81% 81% -<1%
=======================================
Files 291 291
Lines 20113 20124 +11
Branches 2385 2392 +7
=======================================
+ Hits 16351 16356 +5
- Misses 3150 3152 +2
- Partials 612 616 +4 |
7e779c0
to
7cb1975
Compare
Is this done or WIP? |
7cb1975
to
fbf2e8c
Compare
It is done. Just trying to get the Appveyor-build working, but it is failing because of environment-issues (The network path was not found) Just like this build after merging #2138 : |
It's an unstable test? |
Then all ImpersonatingTargetWrapperTests have suddenly become very unstable, as they are now constantly failing. Or maybe they have become stable ? :) |
Lol |
Will rebuild master to be sure |
Failed also (same issue? - on mobile, hard to check) |
Yes always the same 4 tests (Because the test-constructor throws exception) Guess something has happened with the lookup of the NLogTestUser = "NLogTestUser" on localhost machine (127.0.0.1). Maybe IPv4 vs. IPv6, or reduced rights ?
|
Could you rebuild master again ? I have change the hostname from IPv4 127.0.0.1 to Environment.MachineName and now this PR builds. Just want to make sure if the fix is valid, or something has been fixed at appveyor |
Queued! |
Master still fails, so I guess IPv4 127.0.0.1 is no longer working, and using Environment.MachineName fixes the issue. |
@@ -1260,11 +1260,11 @@ private void ConfigFileChanged(object sender, EventArgs args) | |||
/// <summary> | |||
/// Logger cache key. | |||
/// </summary> | |||
internal class LoggerCacheKey : IEquatable<LoggerCacheKey> | |||
internal struct LoggerCacheKey : IEquatable<LoggerCacheKey> |
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.
What's the idea of the struct? AFAIK it's not in line with https://msdn.microsoft.com/en-us/library/ms229017(v=vs.110).aspx ?
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.
Looks very much in line:
- are commonly embedded in other objects (Dictionary key)
- It logically represents a single value (Its a key)
- It has an instance size under 16 bytes (check)
- It is immutable (check)
- It will not have to be boxed frequently (check)
The reason is to avoid garbage when doing dictionary-lookup, which is right now done for every Trace-event.
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.
you're right! was reading it incorrectly! 👍
b166eb4
to
ff3d23e
Compare
ff3d23e
to
78e7b31
Compare
@304NotModified Squashed after merge with #2140 |
thanks! |
Check the configured Trace-Filter before creating LogEventInfo object.
Check the LogLevel before creating LogEventInfo object.