Merge pull request #12786 from ptabor/20210318-debug-env

client: Bring back ETCD_CLIENT_DEBUG variable interpretation.
This commit is contained in:
Piotr Tabor
2021-03-18 21:55:51 +01:00
committed by GitHub
14 changed files with 75 additions and 128 deletions

View File

@@ -1,27 +0,0 @@
// Copyright 2016 The etcd Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package clientv3test
import (
"io/ioutil"
"go.etcd.io/etcd/client/v3"
"google.golang.org/grpc/grpclog"
)
func init() {
clientv3.SetLogger(grpclog.NewLoggerV2(ioutil.Discard, ioutil.Discard, ioutil.Discard))
}

View File

@@ -777,7 +777,11 @@ func NewClientV3(m *member) (*clientv3.Client, error) {
if m.DialOptions != nil {
cfg.DialOptions = append(cfg.DialOptions, m.DialOptions...)
}
return newClientV3(cfg)
c, err := newClientV3(cfg)
if err != nil {
return nil, err
}
return c.WithLogger(m.Logger.Named("client")), nil
}
// Clone returns a member with the same server configuration. The returned

View File

@@ -1,27 +0,0 @@
// Copyright 2016 The etcd Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package integration
import (
"io/ioutil"
"go.etcd.io/etcd/client/v3"
"google.golang.org/grpc/grpclog"
)
func init() {
clientv3.SetLogger(grpclog.NewLoggerV2(ioutil.Discard, ioutil.Discard, ioutil.Discard))
}

View File

@@ -18,21 +18,13 @@
package v2store_test
import (
"io/ioutil"
"testing"
"go.etcd.io/etcd/client/v3"
"go.etcd.io/etcd/server/v3/etcdserver/api/v2store"
"go.etcd.io/etcd/server/v3/etcdserver/api/v2v3"
"go.etcd.io/etcd/tests/v3/integration"
"google.golang.org/grpc/grpclog"
)
func init() {
clientv3.SetLogger(grpclog.NewLoggerV2(ioutil.Discard, ioutil.Discard, ioutil.Discard))
}
type v2v3TestStore struct {
v2store.Store
clus *integration.ClusterV3