logger
logger copied to clipboard
feat: add option to omit query string from path matching and logging
Adds an option (default disabled for backwards compatibility) to change the handling of the path field to omit the query string.
When enabled:
- The
pathis logged without the query string - The query string, if non-empty, is logged in a new
queryfield - The
pathwithout the query string is used for matching in the theWithSkipPath,WithSkipPathRegexps, andWithPathLeveloptions
Why?
- With structured log aggregators, being able to aggregate on the base path without highly variable query strings can be helpful
- Overriding log levels by path is similarly likely to want to use the base path ignoring variable / user-submitted query strings
(This previously was #108, but it was closed by accident due to a push to a private repo referencing that PR)
:warning: Please install the to ensure uploads and comments are reliably processed by Codecov.
Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 90.53%. Comparing base (
d96c742) to head (a1ac8d3). Report is 56 commits behind head on master.
:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files
@@ Coverage Diff @@
## master #110 +/- ##
==========================================
- Coverage 94.24% 90.53% -3.72%
==========================================
Files 2 2
Lines 139 169 +30
==========================================
+ Hits 131 153 +22
- Misses 5 14 +9
+ Partials 3 2 -1
| Flag | Coverage Δ | |
|---|---|---|
| go- | ? |
|
| go-1.18 | ? |
|
| go-1.19 | ? |
|
| go-1.20 | ? |
|
| go-1.21 | ? |
|
| go-1.22 | ? |
|
| go-1.23 | 90.53% <100.00%> (?) |
|
| go-1.24 | 90.53% <100.00%> (?) |
|
| macos-latest | ? |
|
| ubuntu-latest | 90.53% <100.00%> (-3.72%) |
:arrow_down: |
Flags with carried forward coverage won't be shown. Click here to find out more.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
:rocket: New features to boost your workflow:
- :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
Please resolve the conflicts.
@appleboy done!