Skip to content

logger: allow skipping query string output#4547

Merged
appleboy merged 2 commits into
gin-gonic:masterfrom
USA-RedDragon:master
Feb 27, 2026
Merged

logger: allow skipping query string output#4547
appleboy merged 2 commits into
gin-gonic:masterfrom
USA-RedDragon:master

Conversation

@USA-RedDragon
Copy link
Copy Markdown
Contributor

@USA-RedDragon USA-RedDragon commented Feb 24, 2026

This is useful for APIs that might have sensitive information in the query string, such as API keys.

This patch does not change the default behavior of the code unless the new SkipQueryString config option is passed in.

The "skip" term is a bit of a misnomer here, as this doesn't actually skip that log, but modifies the output. I'm open to suggestions for a more appropriate name.

Reopening after #4019 was closed unceremoniously with no comment

Pull Request Checklist

Please ensure your pull request meets the following requirements:

  • Open your pull request against the master branch.
  • All tests pass in available continuous integration systems (e.g., GitHub Actions).
  • Tests are added or modified as needed to cover code changes.
  • If the pull request introduces a new feature, the feature is documented in the docs/doc.md.

Thank you for contributing!

This is useful for APIs that might have sensitive information in the query string, such as API keys.

This patch does not change the default behavior of the code unless the new `SkipQueryString` config option is passed in.

The "skip" term is a bit of a misnomer here, as this doesn't actually skip that log, but modifies the output. I'm open to suggestions for a more appropriate name.
@codecov
Copy link
Copy Markdown

codecov Bot commented Feb 24, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.07%. Comparing base (3dc1cd6) to head (47b0f65).
⚠️ Report is 255 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4547      +/-   ##
==========================================
- Coverage   99.21%   99.07%   -0.14%     
==========================================
  Files          42       46       +4     
  Lines        3182     3038     -144     
==========================================
- Hits         3157     3010     -147     
- Misses         17       19       +2     
- Partials        8        9       +1     
Flag Coverage Δ
?
--ldflags="-checklinkname=0" -tags sonic 99.00% <100.00%> (?)
-tags go_json 98.93% <100.00%> (?)
-tags nomsgpack 99.06% <100.00%> (?)
go-1.18 ?
go-1.19 ?
go-1.20 ?
go-1.21 ?
go-1.24 99.07% <100.00%> (?)
go-1.25 99.01% <100.00%> (?)
go-1.26 99.01% <100.00%> (?)
macos-latest 99.07% <100.00%> (-0.14%) ⬇️
ubuntu-latest 99.01% <100.00%> (-0.21%) ⬇️

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.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@appleboy appleboy added this to the v1.12 milestone Feb 27, 2026
@appleboy appleboy merged commit db30908 into gin-gonic:master Feb 27, 2026
36 of 37 checks passed
@appleboy
Copy link
Copy Markdown
Member

@USA-RedDragon Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants