-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
domain,owner: unify and normalize the format of the log #9646
Conversation
owner/manager.go
Outdated
@@ -155,7 +156,7 @@ func NewSession(ctx context.Context, logPrefix string, etcdCli *clientv3.Client, | |||
break | |||
} | |||
if failedCnt%logIntervalCnt == 0 { | |||
log.Warnf("%s failed to new session to etcd, err %v", logPrefix, err) | |||
log.Warn("Failed to new session to etcd", zap.String("logPrefix", logPrefix), zap.Error(err)) |
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.
I'm not sure what I do is correct.
How to solve the variable logPrefix
?
owner/manager.go
Outdated
@@ -189,7 +190,7 @@ func (m *ownerManager) ResignOwner(ctx context.Context) error { | |||
return errors.Trace(err) | |||
} | |||
|
|||
log.Warnf("%s Resign ddl owner success!", m.logPrefix) | |||
log.Warn("Resign ddl owner success!", zap.String("logPrefix", m.logPrefix)) |
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.
s/Warn/Info?
I don't understand why this log is Warning
.
Codecov Report
@@ Coverage Diff @@
## master #9646 +/- ##
================================================
- Coverage 67.2941% 67.2878% -0.0063%
================================================
Files 385 385
Lines 80588 80600 +12
================================================
+ Hits 54231 54234 +3
- Misses 21502 21508 +6
- Partials 4855 4858 +3 |
Because of the weekly meeting discussed, this PR will work in progress for logutil. |
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.
reset LGTM
@zimulala
|
@xiekeyi98 |
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
/run-all-tests |
/run-all-tests |
/run-common-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.
LGTM
/run-common-test |
/run-common-test -tidb-test=pr/763 |
/run-common-test tidb-test=pr/763 |
What problem does this PR solve?
Unify and normalize the format of the log in the pkg of domain and owner.
What is changed and how it works?
Change
log "github.com/sirupsen/logrus"
togithub.com/pingcap/log
.Check List
Tests