-
Notifications
You must be signed in to change notification settings - Fork 29
refactor: improve logging in console for macaron commands #1160
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
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 |
src/macaron/console.py
Outdated
self.rich_handler = RichConsoleHandler() | ||
|
||
def set_handler(self, verbose: bool) -> RichConsoleHandler: | ||
"""Set the verbosity and create a new RichConsoleHandler instance.""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please make sure to include Parameters
, Returns
, and if needed Raises
for exceptions in the docstrings. This comment applies to all the docstrings.
See our contribution guideline here: https://oracle.github.io/macaron/pages/developers_guide/style_guide.html#docstrings
3cff491
to
930fa41
Compare
pyproject.toml
Outdated
"cryptography >=44.0.0,<45.0.0", | ||
"semgrep == 1.113.0", | ||
"email-validator >=2.2.0,<3.0.0", | ||
"rich ~= 13.5", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"rich ~= 13.5", | |
"rich >=13.5.3,<15.0.0", |
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>
dd959c9
to
4743d6d
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.
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.