move trace log to condition

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
Василий Толстов 2021-01-20 22:16:59 +03:00
parent ef49b96583
commit 51f77581bc

View File

@ -207,10 +207,10 @@ func (k *kBroker) Publish(ctx context.Context, topic string, msg *broker.Message
wCtx = ctx
}
err = writer.WriteMessages(wCtx, kmsg)
if err != nil {
if k.opts.Logger.V(logger.TraceLevel) {
k.opts.Logger.Tracef(k.opts.Context, "write message err: %v", err)
}
if err != nil {
switch cached {
case false:
// non cached case, we can try to wait on some errors, but not timeout