From 33cbb7a1d97130417f07f2f14ca7e62ff7828e70 Mon Sep 17 00:00:00 2001 From: Francesco Renzi Date: Mon, 2 Feb 2026 11:12:44 +0100 Subject: [PATCH] log --- client.go | 3 +++ common_client.go | 14 ++++++++------ 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/client.go b/client.go index f46b4b6..3cd39c9 100644 --- a/client.go +++ b/client.go @@ -7,6 +7,7 @@ import ( "encoding/json" "fmt" "io" + "log/slog" "maps" "net/http" "net/url" @@ -835,6 +836,8 @@ func (c *Client) getActionsServiceAdminConnection(ctx context.Context, rt *regis return nil, fmt.Errorf("failed to get actions service admin connection: %w", err) } + slog.Info("got connection", *adminConnection.ActionsServiceURL, c.userAgent) + return adminConnection, nil } diff --git a/common_client.go b/common_client.go index 6ae6efe..e43040e 100644 --- a/common_client.go +++ b/common_client.go @@ -4,6 +4,7 @@ import ( "bytes" "crypto/tls" "crypto/x509" + "encoding/json" "fmt" "io" "log/slog" @@ -132,12 +133,13 @@ func (c *commonClient) setSystemInfo(info SystemInfo) { } func (c *commonClient) setUserAgent() { - // b, _ := json.Marshal(userAgent{ - // SystemInfo: c.systemInfo, - // BuildVersion: buildInfo.version, - // BuildCommitSHA: buildInfo.commitSHA, - // }) - c.userAgent = "dockerscaleset" + b, _ := json.Marshal(userAgent{ + SystemInfo: c.systemInfo, + BuildVersion: buildInfo.version, + BuildCommitSHA: buildInfo.commitSHA, + }) + c.userAgent = string(b) + slog.Info("user agent", "useragent", c.userAgent) } // HTTPOption defines a functional option for configuring the Client.