Skip to content
Snippets Groups Projects
Commit 179f0054 authored by Jono Wenger's avatar Jono Wenger
Browse files

Add debug messages to group chat

parent b8191b71
No related branches found
No related tags found
1 merge request!53Release
...@@ -9,6 +9,7 @@ package groupChat ...@@ -9,6 +9,7 @@ package groupChat
import ( import (
"github.com/pkg/errors" "github.com/pkg/errors"
jww "github.com/spf13/jwalterweatherman"
gs "gitlab.com/elixxir/client/groupChat/groupStore" gs "gitlab.com/elixxir/client/groupChat/groupStore"
"gitlab.com/elixxir/crypto/contact" "gitlab.com/elixxir/crypto/contact"
"gitlab.com/elixxir/crypto/fastRNG" "gitlab.com/elixxir/crypto/fastRNG"
...@@ -79,6 +80,9 @@ func (m Manager) MakeGroup(membership []*id.ID, name, msg []byte) (gs.Group, ...@@ -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) 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 // Send all group requests
roundIDs, status, err := m.sendRequests(g) roundIDs, status, err := m.sendRequests(g)
......
...@@ -9,6 +9,7 @@ package groupChat ...@@ -9,6 +9,7 @@ package groupChat
import ( import (
"github.com/pkg/errors" "github.com/pkg/errors"
jww "github.com/spf13/jwalterweatherman"
"gitlab.com/elixxir/client/api" "gitlab.com/elixxir/client/api"
gs "gitlab.com/elixxir/client/groupChat/groupStore" gs "gitlab.com/elixxir/client/groupChat/groupStore"
"gitlab.com/elixxir/client/interfaces" "gitlab.com/elixxir/client/interfaces"
...@@ -127,6 +128,8 @@ func (m Manager) JoinGroup(g gs.Group) error { ...@@ -127,6 +128,8 @@ func (m Manager) JoinGroup(g gs.Group) error {
return errors.Errorf(joinGroupErr, g.ID, err) return errors.Errorf(joinGroupErr, g.ID, err)
} }
jww.DEBUG.Printf("Joined group %s.", g.ID)
return nil return nil
} }
...@@ -136,17 +139,21 @@ func (m Manager) LeaveGroup(groupID *id.ID) error { ...@@ -136,17 +139,21 @@ func (m Manager) LeaveGroup(groupID *id.ID) error {
return errors.Errorf(leaveGroupErr, groupID, err) return errors.Errorf(leaveGroupErr, groupID, err)
} }
jww.DEBUG.Printf("Left group %s.", groupID)
return nil return nil
} }
// GetGroups returns a list of all registered groupChat IDs. // GetGroups returns a list of all registered groupChat IDs.
func (m Manager) GetGroups() []*id.ID { func (m Manager) GetGroups() []*id.ID {
jww.DEBUG.Print("Getting list of all groups.")
return m.gs.GroupIDs() return m.gs.GroupIDs()
} }
// GetGroup returns the group with the matching ID or returns false if none // GetGroup returns the group with the matching ID or returns false if none
// exist. // exist.
func (m Manager) GetGroup(groupID *id.ID) (gs.Group, bool) { func (m Manager) GetGroup(groupID *id.ID) (gs.Group, bool) {
jww.DEBUG.Printf("Getting group with ID %s.", groupID)
return m.gs.Get(groupID) return m.gs.Get(groupID)
} }
......
...@@ -9,6 +9,7 @@ package groupChat ...@@ -9,6 +9,7 @@ package groupChat
import ( import (
"github.com/pkg/errors" "github.com/pkg/errors"
jww "github.com/spf13/jwalterweatherman"
gs "gitlab.com/elixxir/client/groupChat/groupStore" gs "gitlab.com/elixxir/client/groupChat/groupStore"
"gitlab.com/elixxir/client/interfaces/params" "gitlab.com/elixxir/client/interfaces/params"
"gitlab.com/elixxir/crypto/group" "gitlab.com/elixxir/crypto/group"
...@@ -48,6 +49,8 @@ func (m *Manager) Send(groupID *id.ID, message []byte) (id.Round, error) { ...@@ -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) return 0, errors.Errorf(sendManyCmixErr, m.gs.GetUser().ID, groupID, err)
} }
jww.DEBUG.Printf("Sent message to group %s.", groupID)
return rid, nil return rid, nil
} }
......
...@@ -10,6 +10,7 @@ package groupChat ...@@ -10,6 +10,7 @@ package groupChat
import ( import (
"github.com/golang/protobuf/proto" "github.com/golang/protobuf/proto"
"github.com/pkg/errors" "github.com/pkg/errors"
jww "github.com/spf13/jwalterweatherman"
gs "gitlab.com/elixxir/client/groupChat/groupStore" gs "gitlab.com/elixxir/client/groupChat/groupStore"
"gitlab.com/elixxir/client/interfaces/message" "gitlab.com/elixxir/client/interfaces/message"
"gitlab.com/elixxir/client/interfaces/params" "gitlab.com/elixxir/client/interfaces/params"
...@@ -34,6 +35,8 @@ func (m Manager) ResendRequest(groupID *id.ID) ([]id.Round, RequestStatus, error ...@@ -34,6 +35,8 @@ func (m Manager) ResendRequest(groupID *id.ID) ([]id.Round, RequestStatus, error
return nil, NotSent, errors.Errorf(resendGroupIdErr, groupID) return nil, NotSent, errors.Errorf(resendGroupIdErr, groupID)
} }
jww.DEBUG.Printf("Resending group requests for group %s.", groupID)
return m.sendRequests(g) return m.sendRequests(g)
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment