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

chore: remove duplication log to msg #69

Merged
merged 1 commit into from
Mar 1, 2024
Merged

chore: remove duplication log to msg #69

merged 1 commit into from
Mar 1, 2024

Conversation

Dreamacro
Copy link
Contributor

fields already contain path, so we don't need to log path on msg again.

zap/zap.go

Lines 69 to 77 in d017ca5

fields := []zapcore.Field{
zap.Int("status", c.Writer.Status()),
zap.String("method", c.Request.Method),
zap.String("path", path),
zap.String("query", query),
zap.String("ip", c.ClientIP()),
zap.String("user-agent", c.Request.UserAgent()),
zap.Duration("latency", latency),
}

I don't think this will cause a break change because we can't rely on the msg field.

BTW, fix the code from space to tab

@codecov-commenter
Copy link

codecov-commenter commented Mar 1, 2024

Codecov Report

Attention: Patch coverage is 50.00000% with 3 lines in your changes are missing coverage. Please review.

Project coverage is 40.00%. Comparing base (d017ca5) to head (0441167).
Report is 3 commits behind head on master.

Files Patch % Lines
zap.go 50.00% 2 Missing and 1 partial ⚠️

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

Additional details and impacted files
@@           Coverage Diff           @@
##           master      #69   +/-   ##
=======================================
  Coverage   40.00%   40.00%           
=======================================
  Files           1        1           
  Lines          90       90           
=======================================
  Hits           36       36           
  Misses         51       51           
  Partials        3        3           
Flag Coverage Δ
go- 40.00% <50.00%> (ø)
go-1.19 40.00% <50.00%> (ø)
go-1.20 40.00% <50.00%> (ø)
go-1.21 40.00% <50.00%> (ø)
macos-latest 40.00% <50.00%> (ø)
ubuntu-latest 40.00% <50.00%> (ø)

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 35a621a into gin-contrib:master Mar 1, 2024
7 checks passed
@Dreamacro Dreamacro deleted the remove-log-msg branch March 1, 2024 09:03
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.

None yet

3 participants