feat: add global --log-level option#170
Merged
rhuanbarreto merged 2 commits intomainfrom Mar 24, 2026
Merged
Conversation
- Add global --log-level <error|warn|info|debug> option (default: info) to control CLI log verbosity without environment variables - Connect logDebug/logError/logWarn to Sentry breadcrumbs via a callback hook (avoids circular dependency between log.ts and sentry.ts) - logInfo/logWarn now respect the log level (previously always emitted) - DEBUG=1 env var still works as a shortcut for --log-level debug
Deploying archgate-cli with
|
| Latest commit: |
3747b84
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://6050e564.archgate-cli.pages.dev |
| Branch Preview URL: | https://feat-global-log-level.archgate-cli.pages.dev |
Add logDebug calls to critical code paths that previously had no diagnostic output, making --log-level debug useful for troubleshooting: - upgrade command: install method detection, version comparison, binary download, external upgrade process spawning - binary-upgrade: GitHub API fetch, download size, archive extraction, binary replacement - auth: device code request/polling, GitHub user fetch, token claim - login-flow: step-by-step flow progress, signup fallback - signup: request submission and response status - editor-detect: detection results for all editors - git-files: all git commands, file counts, error fallbacks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
--log-leveloption — Adds--log-level <error|warn|info|debug>(default:info) to the rootarchgatecommand. All subcommands inherit it. Use--log-level debuginstead ofDEBUG=1for easier troubleshooting (e.g.,archgate --log-level debug upgrade)logInfo()andlogWarn()now respect the active log level, so--log-level errorsilences everything except errorslogDebug,logError, andlogWarncalls are now captured as Sentry breadcrumbs via a callback hook (avoids circular dependency betweenlog.tsandsentry.ts). When an error is reported to Sentry, the breadcrumb trail shows the sequence of log events leading to itDEBUG=1env var still works as a shortcut for--log-level debugTest plan
bun test tests/helpers/log.test.ts— 10/10 passbun test tests/helpers/sentry.test.ts— 8/8 passarchgate check— 22/22 ADR checks passbun run build:check— build compilesarchgate --log-level debug upgradeshows debug outputarchgate --log-level error checksuppresses info/warn output