Skip to content

fix(cli): Refactor logging and CLI verbosity to debug flag#95

Merged
misonijnik merged 8 commits intomainfrom
misonijnik/debug-output-log
Apr 17, 2026
Merged

fix(cli): Refactor logging and CLI verbosity to debug flag#95
misonijnik merged 8 commits intomainfrom
misonijnik/debug-output-log

Conversation

@misonijnik
Copy link
Copy Markdown
Member

No description provided.

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.
@misonijnik misonijnik force-pushed the misonijnik/debug-output-log branch from aa7c7b3 to c29f4ca Compare April 17, 2026 15:43
@misonijnik misonijnik merged commit 6cde010 into main Apr 17, 2026
13 checks passed
@misonijnik misonijnik deleted the misonijnik/debug-output-log branch April 17, 2026 16:22
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