Skip to content

Commit

Permalink
Simplify logging
Browse files Browse the repository at this point in the history
  • Loading branch information
chriso committed Apr 19, 2024
1 parent fe713eb commit bacb1c2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions cli/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ Run 'dispatch help run' to learn about Dispatch sessions.`, BridgeSession)
}

func poll(ctx context.Context, client *http.Client, url string) (string, *http.Response, error) {
slog.Debug("getting request from API", "url", url)
slog.Debug("getting request from Dispatch", "url", url)

req, err := http.NewRequestWithContext(ctx, "GET", url, nil)
if err != nil {
Expand Down Expand Up @@ -264,7 +264,7 @@ func poll(ctx context.Context, client *http.Client, url string) (string, *http.R
}

func invoke(ctx context.Context, client *http.Client, url, requestID string, bridgeGetRes *http.Response) error {
slog.Debug("sending request from Dispatch to local application", "endpoint", LocalEndpoint, "request_id", requestID)
slog.Debug("sending request to local application", "endpoint", LocalEndpoint, "request_id", requestID)

// Extract the nested request header/body.
endpointReq, err := http.ReadRequest(bufio.NewReader(bridgeGetRes.Body))
Expand Down Expand Up @@ -359,7 +359,7 @@ func invoke(ctx context.Context, client *http.Client, url, requestID string, bri
pw.CloseWithError(err)
}()

slog.Debug("sending local application response to Dispatch", "request_id", requestID)
slog.Debug("sending response to Dispatch", "request_id", requestID)

// Send the response back to the API.
bridgePostReq, err := http.NewRequestWithContext(ctx, "POST", url, bufio.NewReader(pr))
Expand Down

0 comments on commit bacb1c2

Please sign in to comment.