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

feat(logger): ability to skip logs based on user-defined logic #3593

Merged
merged 13 commits into from
Feb 2, 2024
Merged

feat(logger): ability to skip logs based on user-defined logic #3593

merged 13 commits into from
Feb 2, 2024

Conversation

palvaneh
Copy link
Contributor

@palvaneh palvaneh commented May 3, 2023

It's a backward-compatible update that let users skip logs based on customized logic.

Gin's LoggerConfig only allows configuring SkipPaths. It might not be enough when users need to skip logging based on different params like full path or status code.

@palvaneh
Copy link
Contributor Author

Is there anyone to review?

@jakubno
Copy link

jakubno commented Nov 23, 2023

I want to filter specific route, which contains param id and with current implementation this can't be done. This solution would solve this.

@jakubno
Copy link

jakubno commented Nov 23, 2023

@thinkerou ?

@appleboy appleboy changed the title Ability to skip logs based on user-defined logic feat(logger): Ability to skip logs based on user-defined logic Feb 1, 2024
@appleboy appleboy changed the title feat(logger): Ability to skip logs based on user-defined logic feat(logger): ability to skip logs based on user-defined logic Feb 1, 2024
@appleboy appleboy added this to the v1.10 milestone Feb 1, 2024
@appleboy
Copy link
Member

appleboy commented Feb 1, 2024

@palvaneh Please help to rebase the master branch. I will take it after CI passing.

Copy link

codecov bot commented Feb 2, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (a64286a) 99.21% compared to head (4fc1d35) 99.21%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #3593   +/-   ##
=======================================
  Coverage   99.21%   99.21%           
=======================================
  Files          42       42           
  Lines        3175     3177    +2     
=======================================
+ Hits         3150     3152    +2     
  Misses         17       17           
  Partials        8        8           
Flag Coverage Δ
99.21% <100.00%> (+<0.01%) ⬆️
go-1.18 99.11% <100.00%> (+<0.01%) ⬆️
go-1.19 99.21% <100.00%> (+<0.01%) ⬆️
go-1.20 99.21% <100.00%> (+<0.01%) ⬆️
go-1.21 99.21% <100.00%> (+<0.01%) ⬆️
macos-latest 99.21% <100.00%> (+<0.01%) ⬆️
ubuntu-latest 99.21% <100.00%> (+<0.01%) ⬆️

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.

@appleboy appleboy merged commit c6ae2e6 into gin-gonic:master Feb 2, 2024
37 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants