Skip to content

Commit 3959064

Browse files
committed
debug logging
1 parent ea79715 commit 3959064

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

cluster/gossip_actor.go

+1
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ func (ga *GossipActor) onGossipRequest(r *GossipRequest, ctx actor.Context) {
144144

145145
func (ga *GossipActor) onSetGossipStateKey(r *SetGossipStateKey, ctx actor.Context) {
146146
key, message := r.Key, r.Value
147+
ctx.Logger().Debug("Setting GossipState", slog.String("key", key), slog.Any("message", message))
147148
ga.gossip.SetState(key, message)
148149

149150
if ctx.Sender() != nil {

cluster/gossiper.go

-1
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,6 @@ breakLoop:
235235
g.cluster.Logger().Debug("Stopping Gossip Loop")
236236
break breakLoop
237237
case <-ticker.C:
238-
g.cluster.Logger().Debug("Gossip Loop Tick")
239238
g.blockExpiredHeartbeats()
240239
g.blockGracefullyLeft()
241240
g.SetState(HearthbeatKey, &MemberHeartbeat{

examples/cluster-gossip/node1/main.go

+3
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,15 @@ func startNode() *cluster.Cluster {
5050
as := &cluster.ActorStatistics{}
5151

5252
fmt.Printf("Member %v\n", msg.MemberID)
53+
fmt.Printf("Sequence Number %v\n", msg.SeqNumber)
5354
if unpackErr := msg.Value.UnmarshalTo(as); unpackErr != nil {
5455
//loop over as.ActorCount map
5556
for k, v := range as.ActorCount {
5657
fmt.Printf("ActorCount %v %v\n", k, v)
5758
}
5859

60+
} else {
61+
fmt.Printf("Unpack error %v\n", unpackErr)
5962
}
6063
}
6164
})

0 commit comments

Comments
 (0)