Skip to content

Commit

Permalink
*: use grpclog.LoggerV2
Browse files Browse the repository at this point in the history
Signed-off-by: Gyu-Ho Lee <gyuhox@gmail.com>
  • Loading branch information
gyuho committed Sep 8, 2017
1 parent f37ff4a commit 3b3d392
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions etcdctl/ctlv3/command/global.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import (
"fmt"
"io"
"io/ioutil"
"log"
"os"
"strings"
"time"
Expand All @@ -31,6 +30,7 @@ import (
"github.com/coreos/etcd/pkg/srv"
"github.com/coreos/etcd/pkg/transport"
"github.com/spf13/cobra"
"google.golang.org/grpc/grpclog"
)

// GlobalFlags are flags that defined globally
Expand Down Expand Up @@ -97,7 +97,7 @@ func mustClientFromCmd(cmd *cobra.Command) *clientv3.Client {
ExitWithError(ExitError, derr)
}
if debug {
clientv3.SetLogger(log.New(os.Stderr, "grpc: ", 0))
clientv3.SetLogger(grpclog.NewLoggerV2(os.Stderr, os.Stderr, os.Stderr))
}

endpoints, err := endpointsFromCmd(cmd)
Expand Down
4 changes: 2 additions & 2 deletions tools/benchmark/cmd/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ import (
"context"
"crypto/rand"
"fmt"
"log"
"os"
"strings"

"github.com/coreos/etcd/clientv3"
"github.com/coreos/etcd/pkg/report"
"google.golang.org/grpc/grpclog"
)

var (
Expand Down Expand Up @@ -98,7 +98,7 @@ func mustCreateConn() *clientv3.Client {
return mustCreateConn()
}

clientv3.SetLogger(log.New(os.Stderr, "grpc", 0))
clientv3.SetLogger(grpclog.NewLoggerV2(os.Stderr, os.Stderr, os.Stderr))

if err != nil {
fmt.Fprintf(os.Stderr, "dial error: %v\n", err)
Expand Down
3 changes: 2 additions & 1 deletion tools/functional-tester/etcd-tester/stresser.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ package main

import (
"fmt"
"os"
"strings"
"sync"
"time"
Expand All @@ -24,7 +25,7 @@ import (
"google.golang.org/grpc/grpclog"
)

func init() { grpclog.SetLogger(plog) }
func init() { grpclog.SetLoggerV2(grpclog.NewLoggerV2(os.Stderr, os.Stderr, os.Stderr)) }

type Stresser interface {
// Stress starts to stress the etcd cluster
Expand Down

0 comments on commit 3b3d392

Please sign in to comment.