Skip to content

Commit

Permalink
add logs to troubleshoot response from reportstream (#32)
Browse files Browse the repository at this point in the history
* add logs to troubleshoot response from reportstream

Co-Authored-By: jcrichlake <[email protected]>

* use slog right

Co-Authored-By: jcrichlake <[email protected]>

---------

Co-authored-by: jcrichlake <[email protected]>
  • Loading branch information
somesylvie and jcrichlake authored May 22, 2024
1 parent be6b66d commit 0946793
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/report_stream/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"bytes"
"encoding/json"
"io"
"log/slog"
"net/http"
)

Expand Down Expand Up @@ -50,6 +51,8 @@ func (apiHandler Sender) SendMessage(message []byte) (string, error) {
defer res.Body.Close()

responseBodyBytes, err := io.ReadAll(res.Body)
slog.Info("response body", slog.String("responseBodyBytes", string(responseBodyBytes)))

if err != nil {
return "", err
}
Expand All @@ -60,6 +63,7 @@ func (apiHandler Sender) SendMessage(message []byte) (string, error) {
return "", err
}

slog.Info("report", slog.Any("report", report))
return report.ReportId, nil
}

Expand Down

0 comments on commit 0946793

Please sign in to comment.