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

*: change the log package to logrus #4452

Merged
merged 14 commits into from Sep 8, 2017

Conversation

Projects
None yet
5 participants
@coocood
Member

coocood commented Sep 6, 2017

PD changed the log package to logrus a few month ago, we should use the same log package in TiDB. Otherwise, the logs written by PD client will be lost when logging to a file.

@coocood

This comment has been minimized.

Show comment
Hide comment
@coocood

coocood Sep 6, 2017

Member

/run-all-test

Member

coocood commented Sep 6, 2017

/run-all-test

@andelf

Should delete _vendor/src/github.com/ngaut/log/

😆

return nil
}
// InitLogger initalizes PD's logger.

This comment has been minimized.

@andelf

andelf Sep 6, 2017

Contributor

:) not PD, this is TiDB

@andelf

andelf Sep 6, 2017

Contributor

:) not PD, this is TiDB

This comment has been minimized.

@coocood

coocood Sep 6, 2017

Member

But it's in vendor, we are not supposed to touch the code in vendor.

@coocood

coocood Sep 6, 2017

Member

But it's in vendor, we are not supposed to touch the code in vendor.

const (
defaultLogTimeFormat = "2006/01/02 15:04:05.000"
defaultLogMaxSize = 300 // MB

This comment has been minimized.

@andelf

andelf Sep 6, 2017

Contributor

Any clue for TiDB's max log file size?

@andelf

andelf Sep 6, 2017

Contributor

Any clue for TiDB's max log file size?

This comment has been minimized.

@coocood

coocood Sep 6, 2017

Member

No.

@coocood

coocood Sep 6, 2017

Member

No.

@iamxy

This comment has been minimized.

Show comment
Hide comment
@iamxy

iamxy Sep 6, 2017

Member

CI failed without _vendor/src/github.com/ngaut/log/
:(

Member

iamxy commented Sep 6, 2017

CI failed without _vendor/src/github.com/ngaut/log/
:(

@coocood

This comment has been minimized.

Show comment
Hide comment
@coocood
Member

coocood commented Sep 7, 2017

@coocood

This comment has been minimized.

Show comment
Hide comment
@coocood
Member

coocood commented Sep 7, 2017

@winkyao PTAL

coocood added some commits Sep 7, 2017

@winkyao winkyao added the status/LGT1 label Sep 8, 2017

@@ -179,7 +179,7 @@ func (b *Backoffer) Backoff(typ backoffType, err error) error {
errMsg := fmt.Sprintf("backoffer.maxSleep %dms is exceeded, errors:", b.maxSleep)
for i, err := range b.errors {
// Print only last 3 errors for non-DEBUG log levels.
if log.GetLogLevel() >= log.LOG_LEVEL_DEBUG || i >= len(b.errors)-3 {
if log.GetLevel() == log.DebugLevel || i >= len(b.errors)-3 {

This comment has been minimized.

@tiancaiamao

tiancaiamao Sep 8, 2017

Contributor

why this change?

@tiancaiamao

tiancaiamao Sep 8, 2017

Contributor

why this change?

This comment has been minimized.

@coocood

coocood Sep 8, 2017

Member

Use the logrus API to implement the same logic.

@coocood

coocood Sep 8, 2017

Member

Use the logrus API to implement the same logic.

)
// StartMonitor calls systimeErrHandler if system time jump backward.
func StartMonitor(now func() time.Time, systimeErrHandler func()) {

This comment has been minimized.

@tiancaiamao

tiancaiamao Sep 8, 2017

Contributor

Would Go1.9 fix time jump?

@tiancaiamao

tiancaiamao Sep 8, 2017

Contributor

Would Go1.9 fix time jump?

@tiancaiamao

This comment has been minimized.

Show comment
Hide comment
@tiancaiamao

tiancaiamao Sep 8, 2017

Contributor

LGTM

Contributor

tiancaiamao commented Sep 8, 2017

LGTM

@coocood

This comment has been minimized.

Show comment
Hide comment
@coocood

coocood Sep 8, 2017

Member

/run-all-test

Member

coocood commented Sep 8, 2017

/run-all-test

@coocood

This comment has been minimized.

Show comment
Hide comment
@coocood

coocood Sep 8, 2017

Member

/rebuild

Member

coocood commented Sep 8, 2017

/rebuild

@tiancaiamao tiancaiamao merged commit 88e1666 into master Sep 8, 2017

4 checks passed

ci/circleci Your tests passed on CircleCI!
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
jenkins-ci-tidb/build Jenkins job succeeded.
Details
license/cla Contributor License Agreement is signed.
Details

@tiancaiamao tiancaiamao deleted the coocood/change-log-pkg branch Sep 8, 2017

@iamxy

This comment has been minimized.

Show comment
Hide comment
@iamxy

iamxy Sep 8, 2017

Member

/run-all-test

Member

iamxy commented Sep 8, 2017

/run-all-test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment