mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
functional/rpcpb: make client log less verbose
Signed-off-by: Gyuho Lee <leegyuho@amazon.com>
This commit is contained in:
parent
0926a434b7
commit
d1c7be24b0
@ -25,6 +25,7 @@ import (
|
||||
"go.etcd.io/etcd/clientv3"
|
||||
"go.etcd.io/etcd/clientv3/snapshot"
|
||||
pb "go.etcd.io/etcd/etcdserver/etcdserverpb"
|
||||
"go.etcd.io/etcd/pkg/logutil"
|
||||
"go.etcd.io/etcd/pkg/transport"
|
||||
|
||||
"github.com/dustin/go-humanize"
|
||||
@ -94,10 +95,19 @@ func (m *Member) CreateEtcdClientConfig(opts ...grpc.DialOption) (cfg *clientv3.
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: make this configurable
|
||||
level := "error"
|
||||
if os.Getenv("ETCD_CLIENT_DEBUG") != "" {
|
||||
level = "debug"
|
||||
}
|
||||
lcfg := logutil.DefaultZapLoggerConfig
|
||||
lcfg.Level = zap.NewAtomicLevelAt(logutil.ConvertToZapLevel(level))
|
||||
|
||||
cfg = &clientv3.Config{
|
||||
Endpoints: []string{m.EtcdClientEndpoint},
|
||||
DialTimeout: 10 * time.Second,
|
||||
DialOptions: opts,
|
||||
LogConfig: &lcfg,
|
||||
}
|
||||
if secure {
|
||||
// assume save TLS assets are already stord on disk
|
||||
|
Loading…
x
Reference in New Issue
Block a user