From d8ba18deff7268981363422127836b36561cdc6d Mon Sep 17 00:00:00 2001 From: Asim Aslam Date: Tue, 22 Jan 2019 12:18:33 +0000 Subject: [PATCH] change logging --- broker/http_broker.go | 2 -- server/rpc_server.go | 10 ++++++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/broker/http_broker.go b/broker/http_broker.go index c04f47eb..fefeed4d 100644 --- a/broker/http_broker.go +++ b/broker/http_broker.go @@ -19,7 +19,6 @@ import ( "time" "github.com/google/uuid" - "github.com/micro/go-log" "github.com/micro/go-micro/codec/json" merr "github.com/micro/go-micro/errors" "github.com/micro/go-micro/registry" @@ -397,7 +396,6 @@ func (h *httpBroker) Connect() error { return err } - log.Logf("Broker Listening on %s", l.Addr().String()) addr := h.address h.address = l.Addr().String() diff --git a/server/rpc_server.go b/server/rpc_server.go index 1afeff6e..469a4bc4 100644 --- a/server/rpc_server.go +++ b/server/rpc_server.go @@ -438,7 +438,8 @@ func (s *rpcServer) Start() error { return err } - log.Logf("Transport Listening on %s", ts.Addr()) + log.Logf("Transport [%s] Listening on %s", config.Transport.String(), ts.Addr()) + s.Lock() // swap address addr := s.opts.Address @@ -493,7 +494,12 @@ func (s *rpcServer) Start() error { }() // TODO: subscribe to cruft - return config.Broker.Connect() + if err := config.Broker.Connect(); err != nil { + return err + } + + log.Logf("Broker [%s] Listening on %s", config.Broker.String(), config.Broker.Address()) + return nil } func (s *rpcServer) Stop() error {