dotnet-sdk icon indicating copy to clipboard operation
dotnet-sdk copied to clipboard

feat: Implement Default Logging Hook

Open kylejuliandev opened this issue 1 year ago • 2 comments

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

kylejuliandev avatar Oct 04 '24 20:10 kylejuliandev

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:

Thanks!

beeme1mr avatar Oct 09 '24 20:10 beeme1mr

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

kylejuliandev avatar Oct 09 '24 21:10 kylejuliandev

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.

askpt avatar Jan 09 '25 15:01 askpt

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.

kylejuliandev avatar Jan 09 '25 21:01 kylejuliandev

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

beeme1mr avatar Jan 09 '25 21:01 beeme1mr

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.

codecov[bot] avatar Jan 09 '25 21:01 codecov[bot]