From b5133021204c2e0756bb1d97515a845e07e83cce Mon Sep 17 00:00:00 2001 From: namhq1989 Date: Fri, 30 Dec 2022 12:05:27 +0700 Subject: [PATCH] add debug logs --- server_reqres.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/server_reqres.go b/server_reqres.go index 2edfd6e..60d6450 100644 --- a/server_reqres.go +++ b/server_reqres.go @@ -51,6 +51,10 @@ func (s Server) Subscribe(subject string, cb nats.MsgHandler) (*nats.Subscriptio return nil, errors.New(msg) } + if s.cfg.Debug { + fmt.Printf("[natsio.Server] subscribe to subject #%s \n", subject) + } + return sub, nil } @@ -62,5 +66,9 @@ func (s Server) QueueSubscribe(subject, queue string, cb nats.MsgHandler) (*nats return nil, errors.New(msg) } + if s.cfg.Debug { + fmt.Printf("[natsio.Server] queue subscribe to subject #%s \n", subject) + } + return sub, nil }