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

Add support and tests for more configuration methods #140

Merged
merged 9 commits into from
Oct 7, 2018

Conversation

tsimbalar
Copy link
Member

fixes #121 (similar to the work done in the core repo in serilog/serilog#1194 )

It adds support and tests for :

  • WriteTo.Sink(ILogEventSink logEventSink, LogEventLevel restrictedToMinimumLevel = LevelAlias.Minimum, LoggingLevelSwitch levelSwitch = null)
  • AuditTo.Sink(ILogEventSink logEventSink, LogEventLevel restrictedToMinimumLevel = LevelAlias.Minimum, LoggingLevelSwitch levelSwitch = null)
  • Enrich.With(params ILogEventEnricher[] enrichers) (with surrogate Enrich.With(ILogEventEnricher enricher) )
  • Filter.With(params ILogEventFilter[] filters) (with surrogate Enrich.With(ILogEventFilter filter) ) - this one was already supported, but I added a unit test

I also refactored a bit the part about surrogate configuration methods. There is now less code, and it is more similar to the equivalent code in the core Serilog repo.

Support for `WriteTo.Sink(ILogEventSink logEventSink, LogEventLevel restrictedToMinimumLevel = LevelAlias.Minimum, LoggingLevelSwitch levelSwitch = null)`
Support for `AuditTo.Sink(ILogEventSink logEventSink, LogEventLevel restrictedToMinimumLevel = LevelAlias.Minimum, LoggingLevelSwitch levelSwitch = null)`
Support for `Enrich.With(ILogEventEnricher enricher)`
Turns out  support for `Filter.With(ILogEventFilter filter)` was already there since commit 4424523
so that all methods in the class are dynamically discovered and exposed to Serilog settings as if they were regular extension methods
@tsimbalar tsimbalar mentioned this pull request Oct 6, 2018
@nblumhardt nblumhardt merged commit 9f28bbc into serilog:dev Oct 7, 2018
@tsimbalar tsimbalar deleted the add-supported-methods branch October 13, 2018 13:10
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.

Add more support for some configuration methods
2 participants