Skip to content

Commit

Permalink
chore: log message contents before being sent
Browse files Browse the repository at this point in the history
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 : status-im/status-mobile#18031

Closes [#18206](status-im/status-mobile#18206)
  • Loading branch information
siddarthkay committed Dec 23, 2023
1 parent a90589f commit 9bb691d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.171.38
0.171.39
11 changes: 10 additions & 1 deletion protocol/messenger.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"math"
"math/rand"
"os"
"strconv"
"strings"
"sync"
"time"
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 9bb691d

Please sign in to comment.