Allow to configure restrictedToMinimumLevel via LoggingLevelSwitch#241
Allow to configure restrictedToMinimumLevel via LoggingLevelSwitch#241zvirja wants to merge 1 commit intodatalust:devfrom
Conversation
|
Thanks for sending this. I think the omission was deliberate, because of possible confusion with the In the meantime, one possible workaround would be: .WriteTo.Conditional(
evt => levelSwitch.IsEnabled(evt.Level),
wt => wt.Seq(...)) |
|
@nblumhardt wow, thanks for the suggestion! it works perfectly fine for me. Yet I think we should have the API I am suggesting in this PR. Primarily, to be on par with e.g. As for the breaking change - well, you know better your policies. But feels like it could be just enough to bump the major and have compilation-time compatibility. There is always as well a possibility to just introduce an overload. But you are smart people, you are aware of all of this 😉 So please take your time. Thanks for the fast reply! |
While configuring a sink in Serilog, it's possible to pass both static
LogEventLevel, but also theLoggingLevelSwitchto control the value dynamically. It gives a bit of flexibility. Unfortunately, as of now theconfig.WriteTo.Seq(..)API doesn't allow to pass the value.In this PR I just introduce the parameter, so it's possible to use both static and dynamic value.