From ac3ce1ec16d620046d03aa7e597a17dc74bb69cb Mon Sep 17 00:00:00 2001 From: Asim Aslam Date: Thu, 23 Apr 2020 11:24:39 +0100 Subject: [PATCH] change logging for service startup --- grpc.go | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/grpc.go b/grpc.go index 449455f..3de2332 100644 --- a/grpc.go +++ b/grpc.go @@ -672,8 +672,8 @@ func (g *grpcServer) Register() error { g.RUnlock() if !registered { - if logger.V(logger.DebugLevel, logger.DefaultLogger) { - logger.Debugf("Registry [%s] Registering node: %s", config.Registry.String(), node.Id) + if logger.V(logger.InfoLevel, logger.DefaultLogger) { + logger.Infof("Registry [%s] Registering node: %s", config.Registry.String(), node.Id) } } @@ -707,8 +707,8 @@ func (g *grpcServer) Register() error { opts = append(opts, broker.DisableAutoAck()) } - if logger.V(logger.DebugLevel, logger.DefaultLogger) { - logger.Debugf("Subscribing to topic: %s", sb.Topic()) + if logger.V(logger.InfoLevel, logger.DefaultLogger) { + logger.Infof("Subscribing to topic: %s", sb.Topic()) } sub, err := config.Broker.Subscribe(sb.Topic(), handler, opts...) if err != nil { @@ -768,8 +768,8 @@ func (g *grpcServer) Deregister() error { Nodes: []*registry.Node{node}, } - if logger.V(logger.DebugLevel, logger.DefaultLogger) { - logger.Debugf("Deregistering node: %s", node.Id) + if logger.V(logger.InfoLevel, logger.DefaultLogger) { + logger.Infof("Deregistering node: %s", node.Id) } if err := config.Registry.Deregister(service); err != nil { return err @@ -787,8 +787,8 @@ func (g *grpcServer) Deregister() error { for sb, subs := range g.subscribers { for _, sub := range subs { - if logger.V(logger.DebugLevel, logger.DefaultLogger) { - logger.Debugf("Unsubscribing from topic: %s", sub.Topic()) + if logger.V(logger.InfoLevel, logger.DefaultLogger) { + logger.Infof("Unsubscribing from topic: %s", sub.Topic()) } sub.Unsubscribe() } @@ -852,8 +852,8 @@ func (g *grpcServer) Start() error { return err } - if logger.V(logger.DebugLevel, logger.DefaultLogger) { - logger.Debugf("Broker [%s] Connected to %s", config.Broker.String(), config.Broker.Address()) + if logger.V(logger.InfoLevel, logger.DefaultLogger) { + logger.Infof("Broker [%s] Connected to %s", config.Broker.String(), config.Broker.Address()) } } @@ -930,8 +930,8 @@ func (g *grpcServer) Start() error { // close transport ch <- nil - if logger.V(logger.DebugLevel, logger.DefaultLogger) { - logger.Debugf("Broker [%s] Disconnected from %s", config.Broker.String(), config.Broker.Address()) + if logger.V(logger.InfoLevel, logger.DefaultLogger) { + logger.Infof("Broker [%s] Disconnected from %s", config.Broker.String(), config.Broker.Address()) } // disconnect broker if err := config.Broker.Disconnect(); err != nil {