1
0
mirror of https://github.com/eventials/goevents.git synced 2025-04-24 13:48:53 +08:00
This commit is contained in:
skrater 2017-12-19 16:01:48 -02:00
parent 6ef1633e13
commit b0b2fe3278

View File

@ -240,12 +240,6 @@ func (c *consumer) doDispatch(msg amqplib.Delivery, h *handler, retryCount int32
err := c.callAndHandlePanic(msg, h) err := c.callAndHandlePanic(msg, h)
if err == nil { if err == nil {
logger.WithFields(log.Fields{
"action": h.action,
"body": msg.Body,
"message_id": msg.MessageId,
}).Error("Message handled successfully.")
if !c.autoAck { if !c.autoAck {
msg.Ack(false) msg.Ack(false)
} }
@ -254,7 +248,7 @@ func (c *consumer) doDispatch(msg amqplib.Delivery, h *handler, retryCount int32
if retryCount >= h.maxRetries { if retryCount >= h.maxRetries {
logger.WithFields(log.Fields{ logger.WithFields(log.Fields{
"action": h.action, "action": h.action,
"body": msg.Body, "body": string(msg.Body),
"error": err, "error": err,
"message_id": msg.MessageId, "message_id": msg.MessageId,
}).Error("Maximum retries reached. Giving up.") }).Error("Maximum retries reached. Giving up.")
@ -265,7 +259,7 @@ func (c *consumer) doDispatch(msg amqplib.Delivery, h *handler, retryCount int32
} else { } else {
logger.WithFields(log.Fields{ logger.WithFields(log.Fields{
"action": h.action, "action": h.action,
"body": msg.Body, "body": string(msg.Body),
"error": err, "error": err,
"message_id": msg.MessageId, "message_id": msg.MessageId,
}).Error("Failed to process event. Retrying...") }).Error("Failed to process event. Retrying...")
@ -275,7 +269,7 @@ func (c *consumer) doDispatch(msg amqplib.Delivery, h *handler, retryCount int32
} else { } else {
logger.WithFields(log.Fields{ logger.WithFields(log.Fields{
"action": h.action, "action": h.action,
"body": msg.Body, "body": string(msg.Body),
"error": err, "error": err,
"message_id": msg.MessageId, "message_id": msg.MessageId,
}).Error("Failed to process event.") }).Error("Failed to process event.")