feat: centralize logging and add --verbose, --debug, --log-file flags - #86
feat: centralize logging and add --verbose, --debug, --log-file flags#86rthakkar0555 wants to merge 1 commit into
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #86 +/- ##
=======================================
Coverage ? 42.68%
=======================================
Files ? 17
Lines ? 1989
Branches ? 0
=======================================
Hits ? 849
Misses ? 1140
Partials ? 0
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Hello @rthakkar0555 - thank you for your contributions. Your PR seems a bit outdated. Can you please rebase it and update again? Thank you! |
okk, will work on it... waited long for your reply on this pr .... i will update it and will rais pr soon..... |
|
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Summary
Implements structured logging across the DockSec codebase, replacing
inconsistent print() and console.print() calls with Python's standard
logging module. Adds --verbose, --debug, and --log-file CLI flags
for configurable verbosity.
Closes #52
Problems Fixed
Changes Made
docksec/utils.pyconfigure_logging(verbose, debug, log_file)function--debug→ DEBUG,--verbose→ INFO, default → WARNING--log-fileadds a FileHandler alongside StreamHandlerget_custom_logger()preserved untoucheddocksec/cli.py-v/--verbose— show detailed scan progress--debug— surface raw subprocess output and tool stderr--log-file PATH— write structured logs to fileconfigure_logging()called immediately after args are parseddocksec/docker_scanner.pylogger.info()logger.debug()logger.error()logger.debug()docksec/score_calculator.pylogger.info()logger.debug()docksec/report_generator.pylogger.info()logger.warning()logger.error()tests/test_logging.py(new)Acceptance Criteria Met
Validation
pytest tests/ -v → 37 passed, 0 failures


(6 new logging tests + 31 existing tests, 0 regressions)