From 05eacd74c85179d8f03871827f5467d52744d8fb Mon Sep 17 00:00:00 2001 From: Asim Aslam Date: Thu, 3 Oct 2019 17:30:37 +0100 Subject: [PATCH] Add logging for broker handler --- broker/service/handler/handler.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/broker/service/handler/handler.go b/broker/service/handler/handler.go index 6e78905f..3d59dc2e 100644 --- a/broker/service/handler/handler.go +++ b/broker/service/handler/handler.go @@ -3,6 +3,7 @@ package handler import ( "context" + "github.com/micro/go-micro/util/log" "github.com/micro/go-micro/broker" pb "github.com/micro/go-micro/broker/service/proto" "github.com/micro/go-micro/errors" @@ -13,6 +14,7 @@ type Broker struct { } func (b *Broker) Publish(ctx context.Context, req *pb.PublishRequest, rsp *pb.Empty) error { + log.Debugf("Publishing message to %s topic", req.Topic) err := b.Broker.Publish(req.Topic, &broker.Message{ Header: req.Message.Header, Body: req.Message.Body, @@ -42,6 +44,7 @@ func (b *Broker) Subscribe(ctx context.Context, req *pb.SubscribeRequest, stream return nil } + log.Debugf("Subscribing to %s topic", req.Topic) sub, err := b.Broker.Subscribe(req.Topic, handler, broker.Queue(req.Queue)) if err != nil { return errors.InternalServerError("go.micro.broker", err.Error())