-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
SugaredLogger: Turn error into zap.Error #1185
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1185 +/- ##
=======================================
Coverage 98.34% 98.34%
=======================================
Files 49 49
Lines 2169 2178 +9
=======================================
+ Hits 2133 2142 +9
Misses 28 28
Partials 8 8
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me. Thanks for doing this work!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is great, thanks! Couple of style nits, but otherwise lgtm.
sugar.go
Outdated
fields := make([]Field, 0, len(args)) | ||
var invalid invalidPairs | ||
var seenError bool |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: let's combine these into a var
block
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure! Thank you. Done.
sugar_test.go
Outdated
err := errors.New("qux") | ||
context := []interface{}{"foo", "bar"} | ||
extra := []interface{}{"baz", false} | ||
expectedFields := []Field{String("foo", "bar"), Bool("baz", false)} | ||
extra := []interface{}{err, "baz", false} | ||
expectedFields := []Field{String("foo", "bar"), Error(err), Bool("baz", false)} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: let's combine these into a var
block here as well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Combined into a var block here too. Thank you!
Resolves #1184.
Please let me know what you think! Thanks.