worker icon indicating copy to clipboard operation
worker copied to clipboard

Print instance fields, at Info rather than Debug level

Open soulshake opened this issue 5 years ago • 0 comments

What is the problem that this PR is trying to fix?

Logging more info about each VM we create on GCE in an attempt to address https://github.com/travis-ci/team-blue/issues/862

Currently, we print instance info only in debug mode, and since we print c.instance instead of fmt.Sprintf("%+v", c.instance), we cannot see the field names, only the values.

Before

instance="&{false   false Travis CI bash test VM [0xc420213ce0] [] 0   map[] https://www.googleapis.com/compute/v1/projects/travis-staging-1/zones/us-central1-c/machineTypes/n1-standard-2 0xc420493f10  travis-job-f264f3a9-49ee-4a72-b03d-25f60e262475 [0xc4204aa540] 0xc420493f80  [] false   0xc4208491a0 us-central1-c {0 map[]} [] []}"

After

instance="&{CanIpForward:false CpuPlatform: CreationTimestamp: DeletionProtection:false Description:Travis CI bash test VM Disks:[0xc420590000] GuestAccelerators:[] Id:0 Kind: LabelFingerprint: Labels:map[] MachineType:https://www.googleapis.com/compute/v1/projects/travis-staging-1/zones/us-central1-c/machineTypes/n1-standard-2 Metadata:0xc4203ccd20 MinCpuPlatform: Name:travis-job-3721a40b-a1b4-4442-a25d-c748e1b80e63 NetworkInterfaces:[0xc42056e0c0] Scheduling:0xc4203ccd90 SelfLink: ServiceAccounts:[] StartRestricted:false Status: StatusMessage: Tags:0xc4209e4480 Zone:us-central1-c ServerResponse:{HTTPStatusCode:0 Header:map[]} ForceSendFields:[] NullFields:[]}" 

soulshake avatar Apr 11 '19 14:04 soulshake