serilog / serilog-settings-configuration

A Serilog configuration provider that reads from Microsoft.Extensions.Configuration
Apache License 2.0
446 stars 129 forks source link

Add a way to get the configured log level switches #347

Closed 0xced closed 1 year ago

0xced commented 1 year ago

I have created this pull request as a draft because a few things should be discussed before merging.

  1. I chose LoadedConfiguration for the class holding the loaded log level switches, as proposed by @tsimbalar in https://github.com/serilog/serilog-settings-configuration/issues/206#issuecomment-643762537 I'm not convinced it's the best name and I'm happy to change it to something better.
  2. This LoadedConfiguration class could also expose the log filter switches, although not the internal LoggingFilterSwitchProxy class directly. Maybe through a public ILoggingFilterSwitch interface with a single Expression { get; set; } property?

I am looking forward to your feedback.

Fixes #206

0xced commented 1 year ago

Closing this pull request because it will be 200% better to work on top of #348 to provide access to the configured log level switches. 😎