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

Link logger with gin context. #76

Merged
merged 2 commits into from
Nov 8, 2024

Conversation

cedric-appdirect
Copy link
Contributor

This is trowing just an idea at the moment. This would have to be adjusted once #69 is landed. We might want to make it even optional via config as mutating the logger has performance impact.

@codecov-commenter
Copy link

codecov-commenter commented Jan 8, 2024

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.36%. Comparing base (d96c742) to head (93ccfbf).
Report is 23 commits behind head on master.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           master      #76      +/-   ##
==========================================
+ Coverage   94.24%   94.36%   +0.12%     
==========================================
  Files           2        2              
  Lines         139      142       +3     
==========================================
+ Hits          131      134       +3     
  Misses          5        5              
  Partials        3        3              
Flag Coverage Δ
go- ?
go-1.18 ?
go-1.19 ?
go-1.20 ?
go-1.21 94.36% <100.00%> (+0.12%) ⬆️
go-1.22 94.36% <100.00%> (+0.12%) ⬆️
go-1.23 94.36% <100.00%> (?)
macos-latest ?
ubuntu-latest 94.36% <100.00%> (+0.12%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@cedric-appdirect cedric-appdirect mentioned this pull request Jan 8, 2024
@appleboy appleboy merged commit 1cd04f4 into gin-contrib:master Nov 8, 2024
6 checks passed
@pablomatiasgomez
Copy link
Contributor

@cedric-appdirect with these changes we are seeing again the issues mentioned in #69 as this is mutatin the logger. Not only that, but this is wrong in the sense that is not grabbing the correct logger (using l instead of rl, in case a logger was overwritten), so that is why tests are not failing)

Not sure what is the right fix here as these changes try to save a mutated logger, so we either save the original logger (maybe useless?) or we save the event?

@pablomatiasgomez
Copy link
Contributor

@cedric-appdirect Created #97 to fix this. Let me know your thoughts.

@cedric-appdirect
Copy link
Contributor Author

Indeed, you are right missed that during the rebase.

@cedric-appdirect cedric-appdirect deleted the logger-in-context branch November 21, 2024 18:39
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.

4 participants