Replace debug print() statements with proper logging #21
Reference in New Issue
Block a user
Delete Branch "fix/replace-print-with-logging"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
print()calls inprompt_to_card_pipeline.pywithlogging.getLogger(__name__)callslogger.debug(), card-saved confirmation useslogger.info()--print-clean-text,--print-json) remains on stdoutprint(f"Card generated and saved to: ...")that polluted stdoutWhy
The bare
print()statements polluted stdout, breaking--print-jsonand--json-onlyoutput when piped or parsed byapp.py. The informal messages (mix of English/French like "module successfully charged") had no log level control and made debugging harder, not easier.Test plan
python -c "import ast; ast.parse(...)"— syntax OKcd clean-text-to-keywords && python -m unittest -q— all 10 tests passprint()calls remain (for--print-clean-textand--print-json)Fixes #3