From 887337d40e806f28dc3960e99a22faaf5e31ee95 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Lallement Date: Wed, 6 Mar 2024 13:08:27 +0100 Subject: [PATCH] fix: log information sent to Landscape Co-authored-by: Didier Roche --- windows-agent/internal/proservices/landscape/connection.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/windows-agent/internal/proservices/landscape/connection.go b/windows-agent/internal/proservices/landscape/connection.go index 8f49cc887..a4f2dc824 100644 --- a/windows-agent/internal/proservices/landscape/connection.go +++ b/windows-agent/internal/proservices/landscape/connection.go @@ -9,6 +9,7 @@ import ( "time" landscapeapi "github.com/canonical/landscape-hostagent-api" + "github.com/canonical/ubuntu-pro-for-wsl/common" log "github.com/canonical/ubuntu-pro-for-wsl/common/grpc/logstreamer" "github.com/ubuntu/decorate" "google.golang.org/grpc" @@ -245,6 +246,10 @@ func (conn *connection) sendInfo(info *landscapeapi.HostAgentInfo) (err error) { return errors.New("disconnected") } + //nolint:govet // We are only using copy for logging + logInfo := *info + logInfo.Token = common.Obfuscate(logInfo.GetToken()) + log.Debugf(conn.ctx, "Landscape: sending info: %+v", logInfo) //nolint:govet if err := conn.grpcClient.Send(info); err != nil { return fmt.Errorf("could not send message: %v", err) }