-
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
*: start replacing logger with zap logger #9279
Conversation
/run-all-tests |
/run-integration-ddl-test tidb-test=pr/733 |
PTAL @tiancaiamao @jackysp @lysu |
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
go.mod
Outdated
@@ -48,11 +48,11 @@ require ( | |||
github.com/pingcap/gofail v0.0.0-20181217135706-6a951c1e42c3 | |||
github.com/pingcap/goleveldb v0.0.0-20171020122428-b9ff6c35079e | |||
github.com/pingcap/kvproto v0.0.0-20190110035000-d4fe6b336379 | |||
github.com/pingcap/log v0.0.0-20190129103703-6afc545b8868 |
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.
Why the log is both replaced and updated ?
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.
Because this PR need to add the pingcap/log, but now we use pingcap/log#2 to replace pingcap/log. After the pingcap/log#2 merging, I will remove line90.
PTAL @tiancaiamao |
@@ -250,13 +263,16 @@ func initFileLog(cfg *FileLogConfig, logger *log.Logger) error { | |||
// SlowQueryLogger is used to log slow query, InitLogger will modify it according to config file. | |||
var SlowQueryLogger = log.StandardLogger() | |||
|
|||
// SlowQueryZapLogger is used to log slow query, InitZapLogger will set it according to config file. | |||
var SlowQueryZapLogger *zap.Logger |
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.
should we remove SlowQueryLogger
?
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.
Yes. But not now.
After we replace SlowQueryLogger
with SlowQueryZapLogger
, we can remove it.
@zimulala please merge master and resolve conflicts. |
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
LGTM |
Codecov Report
@@ Coverage Diff @@
## master #9279 +/- ##
==========================================
+ Coverage 67.2% 67.21% +<.01%
==========================================
Files 371 371
Lines 77511 77552 +41
==========================================
+ Hits 52094 52123 +29
- Misses 20767 20772 +5
- Partials 4650 4657 +7
Continue to review full report at Codecov.
|
What problem does this PR solve?
Start replacing with zap logger.
Rely on pingcap/log#2
Relate to pingcap/tidb-test#733
What is changed and how it works?
Replace logger with the global logger
pingcap/log
.And support Unified Log Format.
Check List
Tests
Code changes
Related changes