Replace debug print() statements with proper logging #21

Merged
llabeyrie merged 1 commits from fix/replace-print-with-logging into main 2026-03-19 19:06:41 +00:00
Owner

Summary

  • Replace all 27 debug print() calls in prompt_to_card_pipeline.py with logging.getLogger(__name__) calls
  • Debug messages use logger.debug(), card-saved confirmation uses logger.info()
  • Only legitimate user-facing output (--print-clean-text, --print-json) remains on stdout
  • Removed the unconditional print(f"Card generated and saved to: ...") that polluted stdout

Why

The bare print() statements polluted stdout, breaking --print-json and --json-only output when piped or parsed by app.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 OK
  • cd clean-text-to-keywords && python -m unittest -q — all 10 tests pass
  • Verified only 2 legitimate print() calls remain (for --print-clean-text and --print-json)

Fixes #3

## Summary - Replace all 27 debug `print()` calls in `prompt_to_card_pipeline.py` with `logging.getLogger(__name__)` calls - Debug messages use `logger.debug()`, card-saved confirmation uses `logger.info()` - Only legitimate user-facing output (`--print-clean-text`, `--print-json`) remains on stdout - Removed the unconditional `print(f"Card generated and saved to: ...")` that polluted stdout ## Why The bare `print()` statements polluted stdout, breaking `--print-json` and `--json-only` output when piped or parsed by `app.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 - [x] `python -c "import ast; ast.parse(...)"` — syntax OK - [x] `cd clean-text-to-keywords && python -m unittest -q` — all 10 tests pass - [x] Verified only 2 legitimate `print()` calls remain (for `--print-clean-text` and `--print-json`) Fixes #3
llabeyrie added 1 commit 2026-03-19 18:45:40 +00:00
Replace 27 unconditional print() calls with Python's logging module.
Debug messages now use logger.debug() and the card-saved message uses
logger.info(). Only legitimate user-facing output (--print-json,
--print-clean-text) remains on stdout.

Fixes #3
llabeyrie merged commit 984bbbec18 into main 2026-03-19 19:06:41 +00:00
llabeyrie deleted branch fix/replace-print-with-logging 2026-03-19 19:06:46 +00:00
Sign in to join this conversation.