feat: Implement Default Logging Hook
Work in progress, if anyone has some initial feedback it would be greatly appreciated!
This PR
- Adds in default Logging Hook
Related Issues
Fixes #299
Notes
Follow-up Tasks
How to test
Hey @kylejuliandev, thanks for the PR. Could you please sign off your commits? The CNCF requires you to acknowledge that you're willing and able to donate this code.
To add your Signed-off-by line to every commit in this branch:
- Ensure you have a local copy of your branch by checking out the pull request locally via command line.
- In your local branch, run: git rebase HEAD~3 --signoff
- Force push your changes to overwrite the branch: git push --force-with-lease origin feat/add-logging-hook
Thanks!
Hi @beeme1mr!
No worries, I've pushed up the signed commits now. Happy to donate this code, although it is incomplete at the moment. Will resume and get some unit tests in. Logging semantics (log IDs, log levels, content, etc...) are still left to determine - although I have tried to adhere to the spec
Hey, @kylejuliandev!
Great work on this PR; everything seems good to go. As you pointed out, however, a few unit tests are missing to get this PR out. Would you like some help?
Just a tiny suggestion: I would move the src/OpenFeature/LoggingHook.cs file into src/OpenFeature/Hooks/LoggingHook.cs and change the namespace to OpenFeature.Hooks.
Thanks for the reminder @askpt - I completely forgot about this, my bad!
I have added some unit tests now to cover the LoggingHook. I suspect another task may include updating the README for guidance on how to use the hook.
I suspect another task may include updating the README for guidance on how to use the hook.
Yes please! Here's an example from the Java SDK. Thanks
https://github.com/open-feature/java-sdk?tab=readme-ov-file#logging-hook
Codecov Report
Attention: Patch coverage is 94.04762% with 5 lines in your changes missing coverage. Please review.
Project coverage is 86.13%. Comparing base (
f994234) to head (9ecb92d). Report is 2 commits behind head on main.
| Files with missing lines | Patch % | Lines |
|---|---|---|
| src/OpenFeature/Hooks/LoggingHook.cs | 94.04% | 1 Missing and 4 partials :warning: |
Additional details and impacted files
@@ Coverage Diff @@
## main #308 +/- ##
==========================================
+ Coverage 85.49% 86.13% +0.63%
==========================================
Files 38 39 +1
Lines 1517 1601 +84
Branches 154 173 +19
==========================================
+ Hits 1297 1379 +82
+ Misses 188 186 -2
- Partials 32 36 +4
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.