-
Notifications
You must be signed in to change notification settings - Fork 188
Conversation
Codecov Report
@@ Coverage Diff @@
## master #381 +/- ##
==========================================
Coverage ? 57.534%
==========================================
Files ? 163
Lines ? 16432
Branches ? 0
==========================================
Hits ? 9454
Misses ? 6054
Partials ? 924 |
/run-all-tests tidb=release-3.0 |
@csuzhangxc PTAL |
pkg/log/log.go
Outdated
return | ||
} | ||
if field.Type == zapcore.ErrorType { |
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.
- How about using a
switch
to checkfiled.Type
first? - Can you add a unit test case for this? ref https://github.com/pingcap/tidb-lightning/blob/605760d1b2025d1e1a8b7d0c668c74863d7d1271/lightning/log/log_test.go#L43.
pkg/log/testlogger.go
Outdated
"go.uber.org/zap/zaptest" | ||
) | ||
|
||
// MakeTestLogger creates a Logger instance which produces JSON logs. |
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.
how add a note this function only used for test
?
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.
or we can move it to test file
/run-all-tests tidb=release-3.0 |
@WangXiangUSTC Revised. PTAL |
LGTM |
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.
LGTM
* fix situations when there is extra msg in error.Error * add deal for zap.Error and add UT
What problem does this PR solve?
Son PR of #355.
log.ShortError(err)
may contains extra msg forcontext.Canceled
.What is changed and how it works?
change
==
tostrings.Contains
Check List
Tests