Skip to content
This repository has been archived by the owner on Nov 3, 2021. It is now read-only.

Add support for builder.AddExpression #10

Merged
merged 1 commit into from
Mar 7, 2018

Conversation

tsimbalar
Copy link
Contributor

Second part of #5 : generate key-value settings from an Expression<Func<LoggerConfiguration, LoggerConfiguration>>

Most of the work is in class ConfigurationExpressionSettingsSerializer.

Currently supported features :

  • MinimumLevel.Is() / MinimumLevel.{Level}() / MinimumLevel.Override()
  • Enrich.WithProperty()
  • Enrich.{ExtensionMethod}()
  • WriteTo.{ExtensionMethod}()
  • AuditTo.{ExtensionMethod}()
  • Filter.{ExtensionMethod}()

Currently supported "parameters" :

  • constant expressions
  • new Class() where Class inherits/implements an abstract class / interface
  • public static property / field to acces an abstract class / interface

Tests :

  • expression serilization tests
  • sanity checks (AddExpression(exp) behaves the same as applying the expression)
  • combination tests (combines different settings sources)

Known advanced missing features as TODOs in ConfigurationExpressionSettingsSerializerTests.cs , but they should probably be included in future separate PRs.

Note: this PR sits on top of #9 , so I will rebase it properly once #9 has been merged .

Currently supported features : 
- MinimumLevel.Is() / MinimumLevel.{Level}() / MinimumLevel.Override()
- Enrich.WithProperty()
- Enrich.{ExtensionMethod}()
- WriteTo.{ExtensionMethod}()
- AuditTo.{ExtensionMethod}()
- Filter.{ExtensionMethod}()

Currently suported "parameters" : 
- constant expressions
- new Class() where Class inherits/implements an abstract class / interface
- public static property / field to acces an abstract class / interface

Tests : 
- expression serilization tests
- sanity checks (AddExpression(exp) behaves the same as applying the expression)
- combination tests (combines different settings sources)

Known advanced missing features as TODOs in ConfigurationExpressionSettingsSerializerTests.cs
@tsimbalar tsimbalar force-pushed the addconfigexpression branch from fcc8ba7 to 86caa6e Compare March 5, 2018 07:02
@tsimbalar tsimbalar changed the title [WIP] Add support for builder.AddExpression Add support for builder.AddExpression Mar 5, 2018
@tsimbalar
Copy link
Contributor Author

Ready for review ! 🤓

Thanks !

@nblumhardt
Copy link
Contributor

Super nice! 💯

@nblumhardt nblumhardt merged commit 5efbb89 into serilog-archive:dev Mar 7, 2018
@tsimbalar tsimbalar deleted the addconfigexpression branch March 8, 2018 07:07
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants