Skip to content

Tidy up logging output - #17

Merged
mattbates merged 2 commits into
mainfrom
sd/misc-fixes
Feb 20, 2026
Merged

mattbates merged 2 commits into
mainfrom
sd/misc-fixes

Conversation

@sd109

@sd109 sd109 commented Feb 20, 2026

Copy link
Copy Markdown
Contributor

Uses log.Printf instead of fmt.Printf and fixes the following warning on minispire start up:

% go run ./cmd/main.go# github.com/shoenig/go-m1cpu
../../go/pkg/mod/github.com/shoenig/go-m1cpu@v0.1.6/cpu.go:75:17:
warning: variable length array folded to constant array as an extension
[-Wgnu-folding-constant]

This allows us to redirect to a different output writer by
modifying the default logger.
This fixes the following warning on minispire start up:

% go run ./cmd/main.go# github.com/shoenig/go-m1cpu
../../go/pkg/mod/github.com/shoenig/go-m1cpu@v0.1.6/cpu.go:75:17:
warning: variable length array folded to constant array as an extension
[-Wgnu-folding-constant]
@sd109
sd109 requested a review from mattbates February 20, 2026 12:09
@gemini-code-assist

Copy link
Copy Markdown

Summary of Changes

Hello @sd109, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request refines the application's logging mechanism by standardizing output through the log package instead of fmt. Additionally, it addresses a compiler warning related to go-m1cpu by updating the gopsutil dependency and managing indirect module requirements, ensuring a cleaner build process and more robust dependency management.

Highlights

  • Logging Improvement: Migrated logging from fmt.Printf to log.Printf in workload.go for improved consistency and standard logging practices.
  • Dependency Update: Upgraded the github.com/shirou/gopsutil dependency from v3 to v4, including updating its import path in grpc-authinfo-darwin.go.
  • Warning Resolution: Resolved a go-m1cpu warning by removing the problematic indirect dependency and adjusting module requirements in go.mod and go.sum.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • go.mod
    • Updated github.com/shirou/gopsutil from v3.24.5 to v4.25.8.
    • Removed indirect dependency github.com/shoenig/go-m1cpu v0.1.6.
    • Added indirect dependency github.com/ebitengine/purego v0.8.4.
  • go.sum
    • Updated module checksums to reflect changes in go.mod, including additions for purego and removals for go-m1cpu.
  • pkg/spire-devserver/grpc-authinfo-darwin.go
    • Updated the import path for gopsutil/process to use the v4 version.
  • pkg/spire-devserver/workload.go
    • Replaced fmt.Printf calls with log.Printf for JWT SVID issuance messages.
    • Replaced fmt.Printf calls with log.Printf for WIT SVID issuance messages.
Activity
  • No human activity has been recorded on this pull request yet.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩

@mattbates
mattbates merged commit 3069396 into main Feb 20, 2026
1 check passed
@mattbates
mattbates deleted the sd/misc-fixes branch February 20, 2026 12:11

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

The pull request updates the gopsutil dependency to v4 and replaces fmt.Printf calls with log.Printf for consistent logging, addressing a warning related to go-m1cpu and improving logging practices. However, the new logging statements introduce a security vulnerability by logging sensitive SVID tokens. These tokens are credentials and should not be written to logs, as this could lead to their exposure and compromise.

}

fmt.Printf("JWT SVID issued: %s\n", token)
log.Printf("JWT SVID issued: %s\n", token)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

security-medium medium

While changing fmt.Printf to log.Printf improves consistent logging, logging a JWT SVID token, which is a sensitive credential, introduces a security vulnerability. Logging credentials can lead to their exposure and allow an attacker to impersonate a workload. It is recommended to remove this log statement or log a confirmation message without the token itself.

}

fmt.Printf("WIT-SVID issued: %s\n", token)
log.Printf("WIT-SVID issued: %s\n", token)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

security-medium medium

While using the standard log package instead of fmt.Printf tidies up logging, logging a WIT-SVID token, which is a sensitive credential, introduces a security vulnerability. Logging credentials can lead to their exposure and allow an attacker to impersonate a workload. It is recommended to remove this log statement or log a confirmation message without the token itself.

Comment thread go.mod
github.com/cofide/cofide-sdk-go v0.4.2
github.com/go-jose/go-jose/v4 v4.1.3
github.com/shirou/gopsutil/v3 v3.24.5
github.com/shirou/gopsutil/v4 v4.25.8

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

Updating gopsutil from v3 to v4 is a significant version bump. While the change is necessary to resolve the warning, it's good practice to ensure that there are no breaking API changes that might affect other parts of the codebase. A quick check of the gopsutil v4 migration guide would be beneficial if this hasn't been done already.

Comment thread go.mod
)

require (
github.com/ebitengine/purego v0.8.4 // indirect

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The addition of github.com/ebitengine/purego v0.8.4 // indirect seems to be a new indirect dependency. It's important to understand why this dependency was introduced with the gopsutil update, as it might indicate a new underlying requirement or a change in how gopsutil interacts with system libraries.

Comment thread go.mod
github.com/gobwas/glob v0.2.3 // indirect
github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 // indirect
github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 // indirect
github.com/shoenig/go-m1cpu v0.1.6 // indirect

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The removal of github.com/shoenig/go-m1cpu v0.1.6 // indirect is directly related to the warning mentioned in the PR description. This is a good cleanup, as it removes an unused dependency that was causing compilation warnings.

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.

2 participants