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
8230536171
commit
d2675c13f4
@ -25,6 +25,7 @@ import (
|
|||||||
"go.etcd.io/etcd/clientv3"
|
"go.etcd.io/etcd/clientv3"
|
||||||
"go.etcd.io/etcd/clientv3/snapshot"
|
"go.etcd.io/etcd/clientv3/snapshot"
|
||||||
pb "go.etcd.io/etcd/etcdserver/etcdserverpb"
|
pb "go.etcd.io/etcd/etcdserver/etcdserverpb"
|
||||||
|
"go.etcd.io/etcd/pkg/logutil"
|
||||||
"go.etcd.io/etcd/pkg/transport"
|
"go.etcd.io/etcd/pkg/transport"
|
||||||
|
|
||||||
"github.com/dustin/go-humanize"
|
"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{
|
cfg = &clientv3.Config{
|
||||||
Endpoints: []string{m.EtcdClientEndpoint},
|
Endpoints: []string{m.EtcdClientEndpoint},
|
||||||
DialTimeout: 10 * time.Second,
|
DialTimeout: 10 * time.Second,
|
||||||
DialOptions: opts,
|
DialOptions: opts,
|
||||||
|
LogConfig: &lcfg,
|
||||||
}
|
}
|
||||||
if secure {
|
if secure {
|
||||||
// assume save TLS assets are already stord on disk
|
// assume save TLS assets are already stord on disk
|
||||||
|
Loading…
x
Reference in New Issue
Block a user