From 9bb691d23cc44136a4a1cad4f53e2c1feb4a3434 Mon Sep 17 00:00:00 2001 From: Siddarth Kumar Date: Wed, 20 Dec 2023 13:50:21 +0530 Subject: [PATCH] chore: log message contents before being sent When debugging message reliability we often get the number of messages sent and their IDs but we do not know the content of the messages and the type of message sent. This commit adds debug level logs so that it helps in investigations. ref : https://github.com/status-im/status-mobile/issues/18031 Closes [#18206](https://github.com/status-im/status-mobile/issues/18206) --- VERSION | 2 +- protocol/messenger.go | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/VERSION b/VERSION index d72ed0562b6..17788c6f550 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.171.38 +0.171.39 diff --git a/protocol/messenger.go b/protocol/messenger.go index 31bfd99d160..62e3a39a72f 100644 --- a/protocol/messenger.go +++ b/protocol/messenger.go @@ -11,6 +11,7 @@ import ( "math" "math/rand" "os" + "strconv" "strings" "sync" "time" @@ -2418,7 +2419,15 @@ func (m *Messenger) sendChatMessage(ctx context.Context, message *common.Message response.SetMessages(msg) response.AddChat(chat) - m.logger.Debug("sent message", zap.String("id", message.ID)) + m.logger.Debug("inside sendChatMessage", + zap.String("id", message.ID), + zap.String("text", message.Text), + zap.String("from", message.From), + zap.String("displayName", message.DisplayName), + zap.String("ChatId", message.ChatId), + zap.String("Clock", strconv.FormatUint(message.Clock, 10)), + zap.String("Timestamp", strconv.FormatUint(message.Timestamp, 10)), + ) m.prepareMessages(response.messages) return &response, m.saveChat(chat)