fix: replace log with slog
Some checks failed
CI / build (push) Failing after 4m25s
CI / lint (push) Failing after 3m33s
CI / pkl-validate (push) Successful in 12s
CI / integration-tests (push) Has been skipped
CI / conformance-tests (latest) (push) Has been skipped

This commit is contained in:
2026-02-11 21:22:02 +01:00
parent 638e9f42d5
commit 6fd95c24fb
3 changed files with 32 additions and 17 deletions

View File

@@ -5,7 +5,7 @@ import (
"encoding/json"
"fmt"
"io"
"log"
"log/slog"
"net/http"
"net/url"
"os"
@@ -50,24 +50,24 @@ func authenticatedRequest(method, url, authorization string, urlparams url.Value
request, err := http.NewRequest(method, url, body)
if err != nil {
log.Println("Error: ", err)
slog.Error("Error creating request", "err", err)
return nil, err
}
request.Header.Set("Authorization", authorization)
resp, err := client.Do(request)
if err != nil {
log.Println("Error: ", err)
slog.Error("Error executing request", "err", err)
return nil, err
}
data, err := io.ReadAll(resp.Body)
if err != nil {
log.Println("Error: ", err)
slog.Error("Error reading response", "err", err)
return nil, err
}
log.Println("URL: ", method, "Status Code:", resp.Status, "Body: ", string(data))
slog.Debug("Executed Request", "url", method, "status code", resp.Status, "body", string(data))
return data, nil
}