refactor: improve logging in console for macaron commands#1160
Conversation
|
Thank you for your pull request and welcome to our community! To contribute, please sign the Oracle Contributor Agreement (OCA). To sign the OCA, please create an Oracle account and sign the OCA in Oracle's Contributor Agreement Application. When signing the OCA, please provide your GitHub username. After signing the OCA and getting an OCA approval from Oracle, this PR will be automatically updated. If you are an Oracle employee, please make sure that you are a member of the main Oracle GitHub organization, and your membership in this organization is public. |
3d7155e to
408075b
Compare
185bc5d to
3b04952
Compare
71c1b06 to
3cff491
Compare
|
@Demolus13 Please add |
3cff491 to
930fa41
Compare
dd959c9 to
4743d6d
Compare
behnazh-w
left a comment
There was a problem hiding this comment.
Please add the new --disable-rich-output command to the Sphinx docs:
Signed-off-by: Demolus13 <parth.govale@oracle.com>
Signed-off-by: Demolus13 <parth.govale@oracle.com>
Signed-off-by: Demolus13 <parth.govale@oracle.com>
Signed-off-by: Demolus13 <parth.govale@oracle.com>
Signed-off-by: Demolus13 <parth.govale@oracle.com>
Signed-off-by: Demolus13 <parth.govale@oracle.com>
Signed-off-by: Demolus13 <parth.govale@oracle.com>
Signed-off-by: Demolus13 <parth.govale@oracle.com>
Signed-off-by: Demolus13 <parth.govale@oracle.com>
Signed-off-by: Demolus13 <parth.govale@oracle.com>
Signed-off-by: Demolus13 <parth.govale@oracle.com>
Signed-off-by: Demolus13 <parth.govale@oracle.com>
Signed-off-by: Demolus13 <parth.govale@oracle.com>
Signed-off-by: Demolus13 <parth.govale@oracle.com>
53f7c8f to
6dcb72d
Compare
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.
This PR introduces a custom logger built using Rich UI components and the RichHandler to visually enhance terminal logging. The logger can be imported and used across the codebase, offering function calls that allow modification of what is displayed in the terminal. Whenever data is updated through any of these function calls, the
make_layout()function inconsole.pyis triggered to rebuild the layout. This function runs every 0.1 seconds, ensuring the terminal display is continuously refreshed to reflect the latest state of the application.Description of changes
--disable-rich-outputto 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 foranalyzecommand.src/macaron/policy_engine/policy_engine.py: logging refinements forverify-policycommand.src/macaron/repo_finder/repo_finder.py: logging refinements forfind-sourcecommand.src/macaron/config/defaults.py: logging refinements fordump-defaultscommand.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
verifiedlabel should appear next to all of your commits on GitHub.