refactor: improve logging in console for macaron commands #1160
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
Refactor console logging to provide a clearer, more user‑friendly command output with an optional Rich UI output, while keeping detailed logs. Adds a flag to disable Rich output for default plain text UI.
Description of changes
--disable-rich-output
to fall back to standard logging formats.Modified files
src/macaron/__main__.py
: core logging setup, CLI flag, command dispatch hooks into Rich handler.src/macaron/console.py
: adds/accesses the Rich logging handler module.src/macaron/slsa_analyzer/analyzer.py
: logging refinements foranalyze
command.src/macaron/policy_engine/policy_engine.py
: logging refinements forverify-policy
command.src/macaron/repo_finder/repo_finder.py
: logging refinements forfind-source
command.src/macaron/config/defaults.py
: logging refinements fordump-defaults
command.src/macaron/output_reporter/reporter.py
: small logging/formatting tweaks.src/macaron/policy_engine/results.py
: small logging/formatting tweaks.src/macaron/repo_finder/repo_utils.py
: small logging/formatting tweaks.src/macaron/policy_engine/base_check.py
: log formatting consistency.src/macaron/policy_engine/registry.py
: log formatting consistency.Related issues
Checklist
verified
label should appear next to all of your commits on GitHub.