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 20, 2023
1 parent 959dcbd commit a02b480
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions 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 @@ -2289,6 +2290,15 @@ func (m *Messenger) SendChatMessages(ctx context.Context, messages []*common.Mes

// sendChatMessage takes a minimal message and sends it based on the corresponding chat
func (m *Messenger) sendChatMessage(ctx context.Context, message *common.Message) (*MessengerResponse, error) {
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)),
)
displayName, err := m.settings.DisplayName()
if err != nil {
return nil, err
Expand Down

0 comments on commit a02b480

Please sign in to comment.