Merge pull request #1421 from xiangli-cmu/logging

*: better logging
This commit is contained in:
Xiang Li 2014-10-26 20:13:55 -07:00
commit 000962d689
3 changed files with 6 additions and 4 deletions

View File

@ -526,7 +526,7 @@ func (s *EtcdServer) publish(retryInterval time.Duration) {
cancel()
switch err {
case nil:
log.Printf("etcdserver: published %+v to the cluster", s.attributes)
log.Printf("etcdserver: published %+v to cluster %x", s.attributes, s.Cluster.ID())
return
case ErrStopped:
log.Printf("etcdserver: aborting publish because server is stopped")

View File

@ -974,6 +974,7 @@ func TestPublish(t *testing.T) {
srv := &EtcdServer{
id: 1,
attributes: Attributes{Name: "node1", ClientURLs: []string{"http://a", "http://b"}},
Cluster: &Cluster{},
node: n,
w: w,
}
@ -1007,6 +1008,7 @@ func TestPublish(t *testing.T) {
func TestPublishStopped(t *testing.T) {
srv := &EtcdServer{
node: &nodeRecorder{},
Cluster: &Cluster{},
w: &waitRecorder{},
done: make(chan struct{}),
stopped: make(chan struct{}),

View File

@ -195,7 +195,7 @@ func startEtcd() {
// Start the peer server in a goroutine
urlStr := u.String()
go func() {
log.Print("Listening for peers on ", urlStr)
log.Print("etcd: listening for peers on ", urlStr)
log.Fatal(http.Serve(l, ph))
}()
}
@ -214,7 +214,7 @@ func startEtcd() {
urlStr := u.String()
go func() {
log.Print("Listening for client requests on ", urlStr)
log.Print("etcd: listening for client requests on ", urlStr)
log.Fatal(http.Serve(l, ch))
}()
}
@ -266,7 +266,7 @@ func startProxy() {
host := u.Host
go func() {
log.Print("Listening for client requests on ", host)
log.Print("etcd: proxy listening for client requests on ", host)
log.Fatal(http.Serve(l, ph))
}()
}