Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Print instance fields, at Info rather than Debug level #586

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

soulshake
Copy link
Contributor

@soulshake soulshake commented Apr 11, 2019

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:[]}" 

Copy link
Contributor

@joepvd joepvd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yay!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants