diff --git a/groupChat/makeGroup.go b/groupChat/makeGroup.go index fa230fadcc99f61a4b4a44d0f62aa549ec9ec306..2c277b4384a04e187e722488d43b99357f1eb0e7 100644 --- a/groupChat/makeGroup.go +++ b/groupChat/makeGroup.go @@ -9,6 +9,7 @@ package groupChat import ( "github.com/pkg/errors" + jww "github.com/spf13/jwalterweatherman" gs "gitlab.com/elixxir/client/groupChat/groupStore" "gitlab.com/elixxir/crypto/contact" "gitlab.com/elixxir/crypto/fastRNG" @@ -79,6 +80,9 @@ func (m Manager) MakeGroup(membership []*id.ID, name, msg []byte) (gs.Group, return gs.Group{}, nil, NotSent, errors.Errorf(addGroupErr, err) } + jww.DEBUG.Printf("Created new group %q with ID %s and members %s", + g.Name, g.ID, g.Members) + // Send all group requests roundIDs, status, err := m.sendRequests(g) diff --git a/groupChat/manager.go b/groupChat/manager.go index 2e2d18fadee2e5e246cf3ea42951305e14053963..6691e54154e613678d3b50684aa333a63b9c1f64 100644 --- a/groupChat/manager.go +++ b/groupChat/manager.go @@ -9,6 +9,7 @@ package groupChat import ( "github.com/pkg/errors" + jww "github.com/spf13/jwalterweatherman" "gitlab.com/elixxir/client/api" gs "gitlab.com/elixxir/client/groupChat/groupStore" "gitlab.com/elixxir/client/interfaces" @@ -127,6 +128,8 @@ func (m Manager) JoinGroup(g gs.Group) error { return errors.Errorf(joinGroupErr, g.ID, err) } + jww.DEBUG.Printf("Joined group %s.", g.ID) + return nil } @@ -136,17 +139,21 @@ func (m Manager) LeaveGroup(groupID *id.ID) error { return errors.Errorf(leaveGroupErr, groupID, err) } + jww.DEBUG.Printf("Left group %s.", groupID) + return nil } // GetGroups returns a list of all registered groupChat IDs. func (m Manager) GetGroups() []*id.ID { + jww.DEBUG.Print("Getting list of all groups.") return m.gs.GroupIDs() } // GetGroup returns the group with the matching ID or returns false if none // exist. func (m Manager) GetGroup(groupID *id.ID) (gs.Group, bool) { + jww.DEBUG.Printf("Getting group with ID %s.", groupID) return m.gs.Get(groupID) } diff --git a/groupChat/send.go b/groupChat/send.go index f2baa0953555b13f335111af4d1dd7ae0e01731e..cdb40888ee41c3489fe23f026c1f7e5d05f3caf6 100644 --- a/groupChat/send.go +++ b/groupChat/send.go @@ -9,6 +9,7 @@ package groupChat import ( "github.com/pkg/errors" + jww "github.com/spf13/jwalterweatherman" gs "gitlab.com/elixxir/client/groupChat/groupStore" "gitlab.com/elixxir/client/interfaces/params" "gitlab.com/elixxir/crypto/group" @@ -48,6 +49,8 @@ func (m *Manager) Send(groupID *id.ID, message []byte) (id.Round, error) { return 0, errors.Errorf(sendManyCmixErr, m.gs.GetUser().ID, groupID, err) } + jww.DEBUG.Printf("Sent message to group %s.", groupID) + return rid, nil } diff --git a/groupChat/sendRequests.go b/groupChat/sendRequests.go index 70c5501ec7c6492a1b33f5a5309b2602c38ad06e..cd7913fcf9488d1a5927d4171f7677e99cf245c6 100644 --- a/groupChat/sendRequests.go +++ b/groupChat/sendRequests.go @@ -10,6 +10,7 @@ package groupChat import ( "github.com/golang/protobuf/proto" "github.com/pkg/errors" + jww "github.com/spf13/jwalterweatherman" gs "gitlab.com/elixxir/client/groupChat/groupStore" "gitlab.com/elixxir/client/interfaces/message" "gitlab.com/elixxir/client/interfaces/params" @@ -34,6 +35,8 @@ func (m Manager) ResendRequest(groupID *id.ID) ([]id.Round, RequestStatus, error return nil, NotSent, errors.Errorf(resendGroupIdErr, groupID) } + jww.DEBUG.Printf("Resending group requests for group %s.", groupID) + return m.sendRequests(g) }