Skip to content

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

Merged
appleboy merged 13 commits into
gin-gonic:masterfrom
palvaneh:master
Feb 2, 2024
Merged

appleboy merged 13 commits into
gin-gonic:masterfrom
palvaneh:master

Conversation

@palvaneh

@palvaneh palvaneh commented May 3, 2023 •

Copy link
Copy Markdown
Contributor

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
Copy Markdown
Contributor Author

Is there anyone to review?

@jakubno

jakubno commented Nov 23, 2023

Copy link
Copy Markdown

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

jakubno commented Nov 23, 2023

Copy link
Copy Markdown

@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

appleboy commented Feb 1, 2024

Copy link
Copy Markdown
Member

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

@codecov

codecov Bot commented Feb 2, 2024 •

Copy link
Copy Markdown

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
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