Send etcd client grpc logs to ioutil.Discard
@@ -11,6 +11,7 @@ import (
"crypto/tls"
"errors"
"fmt"
+ "io/ioutil"
"net"
"net/url"
"os"
@@ -21,6 +22,7 @@ import (
"github.com/coreos/etcd/embed"
"github.com/coreos/etcd/pkg/transport"
"github.com/coreos/pkg/capnslog"
+ "google.golang.org/grpc/grpclog"
)
const (
@@ -43,6 +45,10 @@ const (
ClusterStateExisting = "existing"
)
+func init() {
+ clientv3.SetLogger(grpclog.NewLoggerV2(ioutil.Discard, ioutil.Discard, ioutil.Discard))
+}
+
// Config is a configuration for the embedded etcd
type Config struct {
DataDir string
