diff options
author | 2017-06-02 17:19:40 +0100 | |
---|---|---|
committer | 2017-06-02 17:19:40 +0100 | |
commit | bdf71cf25136c3752a8aed5e50a907f15daea689 (patch) | |
tree | fc8f625363d2e2c8298191d1c452b46ec405b31c /middleware/proxy/grpc_test.go | |
parent | 7be066e4de6fae1fc6634d986b75ccb1b7255af6 (diff) | |
download | coredns-bdf71cf25136c3752a8aed5e50a907f15daea689.tar.gz coredns-bdf71cf25136c3752a8aed5e50a907f15daea689.tar.zst coredns-bdf71cf25136c3752a8aed5e50a907f15daea689.zip |
middleware/proxy: silence gprc errors (#699)
* middleware/proxy: silence gprc errors
Add discard logger
* Silence glog crap
* Revert "Silence glog crap"
This reverts commit a15dafbca62b4e91d4c41543b4c06b8c39a5e500.
Diffstat (limited to 'middleware/proxy/grpc_test.go')
-rw-r--r-- | middleware/proxy/grpc_test.go | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/middleware/proxy/grpc_test.go b/middleware/proxy/grpc_test.go index 0eade58a9..1a0d406ec 100644 --- a/middleware/proxy/grpc_test.go +++ b/middleware/proxy/grpc_test.go @@ -3,6 +3,8 @@ package proxy import ( "testing" "time" + + "google.golang.org/grpc/grpclog" ) func pool() []*UpstreamHost { @@ -17,6 +19,8 @@ func pool() []*UpstreamHost { } func TestStartupShutdown(t *testing.T) { + grpclog.SetLogger(discard{}) + upstream := &staticUpstream{ from: ".", Hosts: pool(), @@ -28,7 +32,7 @@ func TestStartupShutdown(t *testing.T) { g := newGrpcClient(nil, upstream) upstream.ex = g - p := &Proxy{Trace: nil} + p := &Proxy{} p.Upstreams = &[]Upstream{upstream} err := g.OnStartup(p) @@ -52,3 +56,13 @@ func TestStartupShutdown(t *testing.T) { t.Errorf("Shutdown didn't remove conns, found %d", len(g.conns)) } } + +// discard is a Logger that outputs nothing. +type discard struct{} + +func (d discard) Fatal(args ...interface{}) {} +func (d discard) Fatalf(format string, args ...interface{}) {} +func (d discard) Fatalln(args ...interface{}) {} +func (d discard) Print(args ...interface{}) {} +func (d discard) Printf(format string, args ...interface{}) {} +func (d discard) Println(args ...interface{}) {} |