Skip to content

feat: add verbose logging to all commands#27

Merged
aaearon merged 1 commit intomainfrom
feat/verbose-logging-all-commands
Feb 19, 2026
Merged

feat: add verbose logging to all commands#27
aaearon merged 1 commit intomainfrom
feat/verbose-logging-all-commands

Conversation

@aaearon
Copy link
Owner

@aaearon aaearon commented Feb 19, 2026

Summary

  • Introduce cmdLogger interface and package-level log var in cmd/verbose.go using the SDK logger (common.GetLogger), ensuring consistent grant | timestamp | INFO | message format across all commands
  • Add verbose logs to update, version, login, logout, configure, and favorites (list/remove/non-interactive add)
  • Migrate 4 ad-hoc [verbose]/Warning: messages in fetchStatusData, buildDirectoryNameMap, buildWorkspaceNameMap, and fetchEligibility to log.Info(), removing the now-unused errWriter io.Writer parameter from these functions

Test plan

  • 8 new _VerboseLogs tests verify expected log messages via spyLogger mock
  • 2 existing _VerboseWarning tests updated to use spyLogger instead of checking stderr buffer
  • Full test suite passes (make test)
  • Lint clean (make lint)
  • Manual: grant update -v shows verbose output
  • Manual: grant version -v shows Go version and OS/Arch
  • Manual: grant favorites list -v shows config loading

Introduce cmdLogger interface and package-level log var in cmd/verbose.go
that uses the SDK logger (common.GetLogger). All commands now emit
verbose output when --verbose is passed:

- update: current version, GitHub slug, latest release
- version: Go version, OS/Arch
- login: profile loading, authenticating
- logout: keyring clearing
- configure: profile/config saving
- favorites: config loading, favorite count, saving

Migrate 4 existing ad-hoc [verbose]/Warning messages in fetchStatusData,
buildDirectoryNameMap, buildWorkspaceNameMap, and fetchEligibility to use
log.Info(), removing the errWriter io.Writer parameter from these functions.

Tests use spyLogger mock to verify log messages without SDK output.
@aaearon aaearon merged commit 6864258 into main Feb 19, 2026
1 check passed
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.

1 participant