add debug logs

This commit is contained in:
namhq1989 2022-12-30 12:05:27 +07:00
parent 415039292b
commit b513302120
1 changed files with 8 additions and 0 deletions

View File

@ -51,6 +51,10 @@ func (s Server) Subscribe(subject string, cb nats.MsgHandler) (*nats.Subscriptio
return nil, errors.New(msg) return nil, errors.New(msg)
} }
if s.cfg.Debug {
fmt.Printf("[natsio.Server] subscribe to subject #%s \n", subject)
}
return sub, nil return sub, nil
} }
@ -62,5 +66,9 @@ func (s Server) QueueSubscribe(subject, queue string, cb nats.MsgHandler) (*nats
return nil, errors.New(msg) return nil, errors.New(msg)
} }
if s.cfg.Debug {
fmt.Printf("[natsio.Server] queue subscribe to subject #%s \n", subject)
}
return sub, nil return sub, nil
} }