fix(cli): Refactor logging and CLI verbosity to debug flag#95
Merged
misonijnik merged 8 commits intomainfrom Apr 17, 2026
Merged
fix(cli): Refactor logging and CLI verbosity to debug flag#95misonijnik merged 8 commits intomainfrom
misonijnik merged 8 commits intomainfrom
Conversation
The logrus file hook no longer filters by user-selected verbosity. JAR subprocess output (logged at Debug) now lands in the log file in every mode, so the per-run log is a reliable record of analyzer and autobuilder execution. SetUpLogs drops its level parameter — the console-side filtering moves to a later commit.
…er output.* Drops the --verbosity info|debug enum in favor of a boolean --debug/-d flag. Moves debug, color, quiet under a single output.* config namespace in YAML and env (OPENTAINT_OUTPUT_DEBUG, etc.); the old log.* block and top-level quiet are removed. Decouples JAR streaming from --quiet — quiet is now truly quiet, no spinner and no JAR mirroring. Debug mode is the only thing that streams JAR output to stderr. Removes the WithStreamOutput builder method on JavaRunner since the decision collapses to a single boolean read. The JAR's own --verbosity flag is still passed through (mapped from the new bool) — that's the external Java tool's CLI, not opentaint's. Breaking change: --verbosity, log.verbosity, log.color, top-level quiet in YAML, and OPENTAINT_LOG_VERBOSITY/_COLOR/OPENTAINT_QUIET env vars all stop working.
Updates the CLI Dockerfile bootstrap and ci-cli.yaml runs to use the new --debug flag. JAR-direct workflows (analyzer-owasp, autobuilder, rules) keep --verbosity debug because that flag belongs to the Java tool, not to opentaint.
Updates user-facing docs (usage, configuration, troubleshooting, docker, README) for the new flag name, the new output.* config namespace, and the new env vars. Adds a note that the per-run log file always captures full JAR output regardless of the new flags.
Two cosmetic fixes flagged in the final code review: - gofmt: trailing blank line in runner_test.go after deleting the shouldStreamJavaOutput tests - stale comments in set_up_logs_test.go that still mentioned the old verbosity argument SetUpLogs no longer takes
Pins the opentaint→JAR translation contract (debug bool ↔ --verbosity=info|debug) so an accidental branch flip during a future refactor wouldn't silently invert what the analyzer subprocess sees. Seeds the first test under cli/cmd/.
Viper accepts unknown YAML keys silently, which would let an old ~/.opentaint/config.yaml drift quietly after the verbosity rename; likewise OPENTAINT_LOG_VERBOSITY, OPENTAINT_LOG_COLOR, and OPENTAINT_QUIET env vars would stop applying with no signal. Emit a one-line warning at startup pointing the user at the new output.* namespace, for both sources. Extends the optional Task 8 from the plan by also covering env vars (not just YAML) since the drift concern is equivalent on both paths. Includes table-driven tests for the hasNestedKey helper.
aa7c7b3 to
c29f4ca
Compare
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.
No description provided.