Skip to content

Fix log line to not be fmt-styled#730

Merged
rdimitrov merged 1 commit into
theupdateframework:masterfrom
abayer:dont-use-fmt-string-in-log-info
May 15, 2026
Merged

Fix log line to not be fmt-styled#730
rdimitrov merged 1 commit into
theupdateframework:masterfrom
abayer:dont-use-fmt-string-in-log-info

Conversation

@abayer
Copy link
Copy Markdown
Contributor

@abayer abayer commented May 14, 2026

We've been seeing Failed to verify %s with key ID %s a bunch in the logs from a service of ours that's consuming a TUF root, and it's a bit confusing to see what appears to be a fmt-style line that isn't actually fmted. This PR changes that log.Info call to work like the one a bit below it for when a key ID is verified for the role.

We've been seeing `Failed to verify %s with key ID %s` a bunch in the logs from a service of ours that's consuming a TUF root, and it's a bit confusing to see what appears to be a `fmt`-style line that isn't actually `fmt`ed. This PR changes that `log.Info` call to work like the one a bit below it for when a key ID is verified for the role.

Signed-off-by: Andrew Bayer <andrew.bayer@gmail.com>
Copilot AI review requested due to automatic review settings May 14, 2026 15:07
@abayer abayer requested a review from a team as a code owner May 14, 2026 15:07
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Fixes a misleading log statement in VerifyDelegate that used fmt-style format specifiers (%s) with log.Info, which doesn't perform string formatting. The line is updated to use structured key/value logging, consistent with the success-case log call immediately below it.

Changes:

  • Replace log.Info("Failed to verify %s with key ID %s", delegatedRole, keyID) with structured key/value form matching the neighboring success log.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown
Contributor

@rdimitrov rdimitrov left a comment

Choose a reason for hiding this comment

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

Thanks! 🙌

@rdimitrov rdimitrov merged commit 45e0a1f into theupdateframework:master May 15, 2026
29 of 30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants