Browse Source

etcdserver: make raft use leveled logger

Xiang Li 10 years ago
parent
commit
3af4a45d7b
1 changed files with 3 additions and 0 deletions
  1. 3 0
      etcdserver/raft.go

+ 3 - 0
etcdserver/raft.go

@@ -31,6 +31,8 @@ import (
 	"github.com/coreos/etcd/rafthttp"
 	"github.com/coreos/etcd/wal"
 	"github.com/coreos/etcd/wal/walpb"
+
+	"github.com/coreos/etcd/Godeps/_workspace/src/github.com/coreos/pkg/capnslog"
 )
 
 const (
@@ -59,6 +61,7 @@ var (
 )
 
 func init() {
+	raft.SetLogger(capnslog.NewPackageLogger("github.com/coreos/etcd", "raft"))
 	expvar.Publish("raft.status", expvar.Func(func() interface{} { return raftStatus() }))
 }