Skip to content

Commit

Permalink
fix: log information sent to Landscape (#666)
Browse files Browse the repository at this point in the history
  • Loading branch information
jibel authored Mar 7, 2024
2 parents a6784f5 + 887337d commit 72b870c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions windows-agent/internal/proservices/landscape/connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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)
}
Expand Down

0 comments on commit 72b870c

Please sign in to comment.