Skip to content

Commit b151299

Browse files
committed
WIP: debug print
1 parent 09cb45c commit b151299

1 file changed

Lines changed: 15 additions & 1 deletion

File tree

test/data_frame_integration_test.go

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,33 @@
1515
package test
1616

1717
import (
18+
"bytes"
1819
"context"
20+
"encoding/json"
21+
"log/slog"
1922
"testing"
2023
"time"
2124

2225
clarify "github.com/clarify/clarify-go"
2326

2427
"github.com/clarify/clarify-go/fields"
28+
"github.com/clarify/clarify-go/jsonrpc"
2529
)
2630

2731
func TestDataFrame(t *testing.T) {
2832
ctx := context.Background()
2933
creds := getCredentials(t)
30-
client := creds.Client(ctx)
34+
h, err := creds.HTTPHandler(ctx)
35+
if err != nil {
36+
t.Fatal(err)
37+
}
38+
h.RequestLogger = func(request jsonrpc.Request, trace string, latency time.Duration, err error) {
39+
var b bytes.Buffer
40+
enc := json.NewEncoder(&b)
41+
_ = enc.Encode(request)
42+
slog.Debug("Performing JSON RPC request", "trace", trace, "latency", latency, "err", err, "body", json.RawMessage(b.Bytes()))
43+
}
44+
client := clarify.NewClient(creds.Integration, h)
3145
prefix := createPrefix()
3246
a := TestArgs{
3347
ctx: ctx,

0 commit comments

Comments
 (0)