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

Custom log filtering #95

Merged
merged 6 commits into from
Aug 21, 2024
Merged

Custom log filtering #95

merged 6 commits into from
Aug 21, 2024

Conversation

adams85
Copy link
Contributor

@adams85 adams85 commented Jul 30, 2024

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)

  • I have covered the applied changes with automated tests.
  • I have executed the full automated test set against my changes.
  • I have validated my changes against all supported platform versions.
  • I have read and accepted the contribution agreement.

@adams85 adams85 requested a review from a team as a code owner July 30, 2024 17:49
src/ConfigCatClient/Utils/LazyString.cs Outdated Show resolved Hide resolved
src/ConfigCatClient/Utils/LazyString.cs Show resolved Hide resolved
@adams85 adams85 force-pushed the feature/logfilter branch from 70c5c3f to c4e59ed Compare August 2, 2024 18:03

public bool IsValueCreated => this.argsOrValue is null or string;

public override string ToString() => Value ?? string.Empty;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

<3

@adams85 adams85 force-pushed the feature/logfilter branch from 648ff6a to e607ac4 Compare August 21, 2024 07:17
Copy link

sonarcloud bot commented Aug 21, 2024

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

@adams85 adams85 merged commit 74b650d into master Aug 21, 2024
4 of 7 checks passed
@adams85 adams85 deleted the feature/logfilter branch August 21, 2024 07:26
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.

2 participants