From 5b981a03324bd94c9b17151a74eb3ae002be1cec Mon Sep 17 00:00:00 2001 From: Quint Daenen Date: Mon, 6 May 2024 12:42:54 +0200 Subject: [PATCH] Add logs for PocketIC polling. --- pocketic/do.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pocketic/do.go b/pocketic/do.go index 8142548..6ada60f 100644 --- a/pocketic/do.go +++ b/pocketic/do.go @@ -35,10 +35,12 @@ func (pic PocketIC) do(method, url string, input, output any) error { if err := json.NewDecoder(resp.Body).Decode(&response); err != nil { return err } + pic.logger.Printf("[POCKETIC] Accepted: %s %s", response.StateLabel, response.OpID) if method == http.MethodGet { continue } for { + pic.logger.Printf("[POCKETIC] Waiting for %s %s", response.StateLabel, response.OpID) if pic.timeout < time.Since(start) { return fmt.Errorf("timeout exceeded") } @@ -81,6 +83,7 @@ func (pic PocketIC) do(method, url string, input, output any) error { if err := json.NewDecoder(resp.Body).Decode(&response); err != nil { return err } + pic.logger.Printf("[POCKETIC] Conflict: %s %s", response.StateLabel, response.OpID) time.Sleep(pic.delay) // Retry after a short delay. continue default: