chore_: better community json log (#5118)

This commit is contained in:
Igor Sirotin 2024-05-08 15:49:41 +01:00 committed by GitHub
parent 2d6ddf733d
commit 1c43b7a29b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 10 additions and 11 deletions

View File

@ -6,7 +6,6 @@ import (
"crypto/ecdsa"
"database/sql"
"encoding/hex"
"encoding/json"
"fmt"
"io/ioutil"
"net"
@ -5428,12 +5427,11 @@ func (m *Manager) encryptCommunityDescriptionImpl(groupID []byte, d *protobuf.Co
return "", nil, err
}
communityJSON, err := json.Marshal(d)
if err != nil {
return "", nil, err
}
m.logger.Debug("encrypting community description",
zap.Any("community", d),
zap.String("groupID", types.Bytes2Hex(groupID)),
zap.String("keyID", types.Bytes2Hex(keyID)))
m.logger.Debug("encrypting community description", zap.String("community", string(communityJSON)), zap.String("groupID", types.Bytes2Hex(groupID)), zap.String("key-id", types.Bytes2Hex(keyID)))
keyIDSeqNo := fmt.Sprintf("%s%d", hex.EncodeToString(keyID), newSeqNo)
return keyIDSeqNo, encryptedPayload, nil

View File

@ -109,11 +109,12 @@ func (m *Messenger) publishOrg(org *communities.Community, shouldRekey bool) err
return nil
}
communityJSON, err := json.Marshal(org)
if err != nil {
return err
}
m.logger.Debug("publishing org", zap.String("org-id", org.IDString()), zap.Uint64("clock", org.Clock()), zap.String("org", string(communityJSON)))
m.logger.Debug("publishing community",
zap.Uint64("clock", org.Clock()),
zap.String("communityID", org.IDString()),
zap.Any("community", org),
)
payload, err := org.MarshaledDescription()
if err != nil {