Skip to content

Commit

Permalink
Add logger
Browse files Browse the repository at this point in the history
Signed-off-by: Dongri Jin <[email protected]>
  • Loading branch information
dongrie committed Jan 9, 2024
1 parent eda21b7 commit ef856ef
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
4 changes: 3 additions & 1 deletion core/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ func (srv *RelayService) Serve(ctx context.Context) error {
}

func (srv *RelayService) shouldExecuteRelay(seqs *RelayPackets) (bool, bool) {

logger := GetChannelPairLogger(srv.src, srv.dst)
var err error

srcRelay := false
Expand Down Expand Up @@ -206,5 +206,7 @@ func (srv *RelayService) shouldExecuteRelay(seqs *RelayPackets) (bool, bool) {
dstRelay = true
}

logger.Info("shouldExecuteRelay", "srcRelay", srcRelay, "dstRelay", dstRelay)

return srcRelay, dstRelay
}
3 changes: 2 additions & 1 deletion tests/cases/tm2tm/scripts/test-service
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ sleep 4

expectUnrelayedCount "unrelayed-packets" "src" 0
expectUnrelayedCount "unrelayed-acknowledgements" "dst" 5
sleep 16
sleep 20

echo "xxxxxxx ${SECONDS} relay service [acks = 5, time = 40] -> exec (time + count) xxxxxx"
sleep 4
Expand All @@ -94,4 +94,5 @@ expectUnrelayedCount "unrelayed-packets" "src" 0
expectUnrelayedCount "unrelayed-acknowledgements" "dst" 0

echo "Finished"

kill $RLY_PID
2 changes: 1 addition & 1 deletion tests/cases/tmmock2tmmock/scripts/test-service
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ sleep 4

expectUnrelayedCount "unrelayed-packets" "src" 0
expectUnrelayedCount "unrelayed-acknowledgements" "dst" 5
sleep 16
sleep 20

echo "xxxxxxx ${SECONDS} relay service [akcs = 3, time = 40] -> exec - time + count xxxxxx"
sleep 4
Expand Down

0 comments on commit ef856ef

Please sign in to comment.