Skip to content

Commit

Permalink
debug logging
Browse files Browse the repository at this point in the history
  • Loading branch information
rogeralsing committed Apr 6, 2024
1 parent ea79715 commit 3959064
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions cluster/gossip_actor.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ func (ga *GossipActor) onGossipRequest(r *GossipRequest, ctx actor.Context) {

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

if ctx.Sender() != nil {
Expand Down
1 change: 0 additions & 1 deletion cluster/gossiper.go
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,6 @@ breakLoop:
g.cluster.Logger().Debug("Stopping Gossip Loop")
break breakLoop
case <-ticker.C:
g.cluster.Logger().Debug("Gossip Loop Tick")
g.blockExpiredHeartbeats()
g.blockGracefullyLeft()
g.SetState(HearthbeatKey, &MemberHeartbeat{
Expand Down
3 changes: 3 additions & 0 deletions examples/cluster-gossip/node1/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,15 @@ func startNode() *cluster.Cluster {
as := &cluster.ActorStatistics{}

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

} else {
fmt.Printf("Unpack error %v\n", unpackErr)
}
}
})
Expand Down

0 comments on commit 3959064

Please sign in to comment.