configcat / .net-sdk

ConfigCat SDK for .NET. ConfigCat is a hosted feature flag service: https://configcat.com. Manage feature toggles across frontend, backend, mobile, desktop apps. Alternative to LaunchDarkly. Management app + feature flag SDKs.
https://configcat.com/docs/sdk-reference/csharp
Other
29 stars 8 forks source link

Custom log filtering #95

Closed adams85 closed 1 month ago

adams85 commented 2 months ago

Describe the purpose of your pull request

Provides a new, more convenient way (ConfigCatClientOptions.LogFilter) for consumers to specify custom log event filter logic.

Also, brings some performance improvements (reduced memory allocation) around log messages and evaluation log building:

ConfigCat.Client.Benchmarks.MatrixTestBenchmark

Diff Method Mean Error Allocated
Old (net6.0, LogInfo = false) MatrixTests_ConfigV6 16.14 ms 0.149 ms 11.75 MB
New (net6.0, LogInfo = false) 16.17 ms (0%) 0.084 ms 11.53 MB (-2%)
Old (net48, LogInfo = false) MatrixTests_ConfigV6 52.67 ms 0.157 ms 17.33 MB
New (net48, LogInfo = false) 52.53 ms (0%) 0.318 ms 16.77 MB (-3%)
Old (net6.0, LogInfo = true) MatrixTests_ConfigV6 49.48 ms 0.204 ms 62.76 MB
New (net6.0, LogInfo = true) 48.92 ms (-1%) 0.444 ms 62.07 MB (-1%)
Old (net48, LogInfo = true) MatrixTests_ConfigV6 138.43 ms 1.004 ms 77.65 MB
New (net48, LogInfo = true) 136.28 ms (-2%) 0.842 ms 73.94 MB (-5%)

Related issues (only if applicable)

https://trello.com/c/IxCFbq2j

Requirement checklist (only if applicable)

sonarcloud[bot] commented 1 month ago

Quality Gate Failed Quality Gate failed

Failed conditions
E Reliability Rating on New Code (required ≥ A)
B Maintainability Rating on New Code (required ≥ A)

See analysis details on SonarCloud

Catch issues before they fail your Quality Gate with our IDE extension SonarLint