Skip to content

Commit

Permalink
added server and client debug prints
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristianMct committed Apr 22, 2024
1 parent c24f65b commit 02dff7f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
5 changes: 4 additions & 1 deletion client.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,11 @@ func (hc *HeliumClient) Register(ctx context.Context) (upstream *coordinator.Cha
}
return
}
eventsStream <- api.ToNodeEvent(apiEvent)

ev := api.ToNodeEvent(apiEvent)
log.Printf("[client] received event: %s", ev)

Check failure on line 171 in client.go

View workflow job for this annotation

GitHub Actions / test

log.Printf format %s has arg ev of wrong type github.com/ChristianMct/helium/node.Event
eventsStream <- ev
log.Printf("[client] fwd event: %s", ev)

Check failure on line 173 in client.go

View workflow job for this annotation

GitHub Actions / test

log.Printf format %s has arg ev of wrong type github.com/ChristianMct/helium/node.Event
}
}()

Expand Down
3 changes: 2 additions & 1 deletion server.go
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ func (hsv *HeliumServer) Register(_ *pb.Void, stream pb.Helium_RegisterServer) e
break
}
}
hsv.Logf("done sending past events to %s, stream is live", nodeID)
hsv.Logf("done sending %d past events to %s, stream is live", present, nodeID)

// Processes the node's sendQueue. The sendQueue channel is closed when exiting the loop
cancelled := stream.Context().Done()
Expand All @@ -234,6 +234,7 @@ func (hsv *HeliumServer) Register(_ *pb.Void, stream pb.Helium_RegisterServer) e
done = true
hsv.Logf("error on stream send for %s: %s", nodeID, err)
}
hsv.Logf("sent to node %s: %s", nodeID, evt)

Check failure on line 237 in server.go

View workflow job for this annotation

GitHub Actions / test

(*github.com/ChristianMct/helium.HeliumServer).Logf format %s has arg evt of wrong type github.com/ChristianMct/helium/node.Event
} else {
done = true
hsv.Logf("update queue for %s closed", nodeID)
Expand Down

0 comments on commit 02dff7f

Please sign in to comment.