Skip to content

Fixes a number of issues with LoggerSinkConfiguration.Wrap() #1165

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

Merged
merged 2 commits into from
May 13, 2018

Conversation

nblumhardt
Copy link
Member

These were identified via the discussion in #1154.

  • Ensures that wt.X(); wt.Y() and wt.X().WriteTo.Y() are equivalent
  • Ensures a failing sink doesn't block events from reaching others inside the same wrapper, much as using a secondary logger would do
  • Prevents chained calls from accidentally breaking thread-safety rules by turning Enrich inside wrappers into a no-op

What issue does this PR address?

Does this PR introduce a breaking change?

Please check if the PR fulfills these requirements

  • The commit follows our guidelines
  • Unit Tests for the changes have been added (for bug fixes / features)

Other information:

…fied in serilog#1154

 - Ensures that `wt.X(); wt.Y()` and `wt.X().WriteTo.Y()` are equivalent
 - Ensures a failing sink doesn't block events from reaching others inside the same wrapper, much as using a secondary logger would do
 - Prevents chained calls from accidentally breaking thread-safety rules by turning `Enrich` inside wrappers into a no-op
@skomis-mm
Copy link
Contributor

👍

configureWrappedSink(capturingLoggerSinkConfiguration);

return loggerSinkConfiguration._loggerConfiguration;
if (!sinksToWrap.Any())
Copy link
Member

Choose a reason for hiding this comment

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

Might as well grab Count as it's used 3 lines down

Copy link
Member Author

Choose a reason for hiding this comment

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

Done :-)

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

Successfully merging this pull request may close these issues.

3 participants