Skip to content

Add --log-level global flag with per-org info success messages#47

Merged
CallMeGreg merged 2 commits into
mainfrom
copilot/add-log-level-flag-and-info-statements
Apr 24, 2026
Merged

Add --log-level global flag with per-org info success messages#47
CallMeGreg merged 2 commits into
mainfrom
copilot/add-log-level-flag-and-info-statements

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 23, 2026

Summary

Adds a global, optional --log-level persistent flag to the extension and wires it into the organization processing output. When the level is info, a success message is printed for each organization that is processed successfully.

This is a non-breaking, patch-level change. The flag is optional and defaults to warning, which preserves the existing output exactly.

Changes

  • cmd/root.go: register the --log-level persistent flag (default warning, values info/warning/error) and parse it in PersistentPreRunE.
  • internal/ui/log.go (new): log-level state (LogLevelInfo/LogLevelWarning/LogLevelError), ParseLogLevel, and a gated LogOrgSuccess helper that uses pterm.Success only when info logging is enabled. State is guarded by a sync.RWMutex so it is safe to read from concurrent workers.
  • internal/processors/sequential.go & internal/processors/concurrent.go: on a successful organization result, call ui.LogOrgSuccess(org) so users running with --log-level info see Successfully processed organization '<name>' for each org.
  • internal/ui/log_test.go (new): table-driven tests for ParseLogLevel and InfoEnabled.
  • README.md: document the new flag under the "Other Flags" section.

Verification

  • go vet ./... passes.
  • go build ./... passes.
  • go test ./... passes.
  • gh security-config --help shows the new flag with the correct default.

Release Type

  • Major - Breaking changes
  • Minor - New features, backwards compatible
  • Patch - Bug fixes, backwards compatible

@CallMeGreg CallMeGreg merged commit df7f993 into main Apr 24, 2026
5 checks passed
@CallMeGreg CallMeGreg deleted the copilot/add-log-level-flag-and-info-statements branch April 24, 2026 20:12
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