Skip to content
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

cluster: omit debug log from console output #977

Merged
merged 4 commits into from
Dec 9, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion components/playground/playground.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import (
"context"
"encoding/json"
"fmt"
"github.com/pingcap/tiup/pkg/cliutil/progress"
"io"
"io/ioutil"
"net/http"
Expand All @@ -37,6 +36,7 @@ import (
"github.com/fatih/color"
"github.com/pingcap/errors"
"github.com/pingcap/tiup/components/playground/instance"
"github.com/pingcap/tiup/pkg/cliutil/progress"
"github.com/pingcap/tiup/pkg/cluster/api"
"github.com/pingcap/tiup/pkg/environment"
pkgver "github.com/pingcap/tiup/pkg/repository/version"
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ require (
github.com/xo/usql v0.7.8
go.etcd.io/etcd v0.5.0-alpha.5.0.20191023171146-3cf2f69b5738
go.uber.org/atomic v1.6.0
go.uber.org/zap v1.15.0
go.uber.org/zap v1.16.0
golang.org/x/crypto v0.0.0-20200204104054-c9f3fb736b72
golang.org/x/mod v0.2.0
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e
Expand Down
3 changes: 2 additions & 1 deletion go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -911,8 +911,9 @@ go.uber.org/zap v1.12.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM=
go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM=
go.uber.org/zap v1.14.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM=
go.uber.org/zap v1.14.1/go.mod h1:Mb2vm2krFEG5DV0W9qcHBYFtp/Wku1cvYaqPsS/WYfc=
go.uber.org/zap v1.15.0 h1:ZZCA22JRF2gQE5FoNmhmrf7jeJJ2uhqDUNRYKm8dvmM=
go.uber.org/zap v1.15.0/go.mod h1:Mb2vm2krFEG5DV0W9qcHBYFtp/Wku1cvYaqPsS/WYfc=
go.uber.org/zap v1.16.0 h1:uFRZXykJGK9lLY4HtgSw44DnIcAM+kRBP7x5m+NpAOM=
go.uber.org/zap v1.16.0/go.mod h1:MA8QOfq0BHJwdXa996Y4dYkAqRKB8/1K1QMMZVaNZjQ=
golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
Expand Down
4 changes: 2 additions & 2 deletions pkg/cluster/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -605,7 +605,7 @@ func (m *Manager) Display(clusterName string, opt operator.Options) error {
// Check if TiKV's label set correctly
pdClient := api.NewPDClient(pdList, 10*time.Second, tlsCfg)
if lbs, err := pdClient.GetLocationLabels(); err != nil {
color.Yellow("\nWARN: get location labels from pd failed: %v", err)
log.Debugf("get location labels from pd failed: %v", err)
} else if err := spec.CheckTiKVLabels(lbs, pdClient); err != nil {
color.Yellow("\nWARN: there is something wrong with TiKV labels, which may cause data losing:\n%v", err)
}
Expand Down Expand Up @@ -1592,7 +1592,7 @@ func (m *Manager) ScaleOut(
return nil
}

// DestroyTombstone destory and remove instances that is in tombstone state
// DestroyTombstone destroy and remove instances that is in tombstone state
func (m *Manager) DestroyTombstone(
clusterName string,
gOpt operator.Options,
Expand Down
2 changes: 1 addition & 1 deletion pkg/logger/audit.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func DisableAuditLog() {
func newAuditLogCore() zapcore.Core {
auditBuffer = bytes.NewBufferString(strings.Join(os.Args, " ") + "\n")
encoder := zapcore.NewConsoleEncoder(zap.NewDevelopmentEncoderConfig())
return zapcore.NewCore(encoder, zapcore.Lock(zapcore.AddSync(auditBuffer)), zapcore.InfoLevel)
return zapcore.NewCore(encoder, zapcore.Lock(zapcore.AddSync(auditBuffer)), zapcore.DebugLevel)
}

// OutputAuditLogIfEnabled outputs audit log if enabled.
Expand Down
2 changes: 0 additions & 2 deletions pkg/logger/log/log.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,8 @@ import (
)

// Debugf output the debug message to console
// Deprecated: Use zap.L().Debug() instead
func Debugf(format string, args ...interface{}) {
zap.L().Debug(fmt.Sprintf(format, args...))
_, _ = fmt.Fprintf(os.Stderr, format+"\n", args...)
}

// Infof output the log message to console
Expand Down