feat: add structured logging to serp_api.py #54

Merged
AI-Manager merged 1 commits from feature/structured-logging into main 2026-03-26 12:05:21 +00:00
Owner

Summary

  • Add logging.getLogger(__name__) logger to serp_api.py
  • Add INFO-level logs for patent queries and PDF downloads
  • Add DEBUG-level logs for cache hits, PDF parsing, and skipped patents
  • All three target files (analyzer.py, serp_api.py, llm.py) now use structured logging
  • Zero print() calls remain in the target files
  • LOG_LEVEL env var (configured in config.py) controls verbosity

Closes #46

Test plan

  • grep -r "print(" SPARC/analyzer.py SPARC/serp_api.py SPARC/llm.py returns no matches
  • Running with LOG_LEVEL=DEBUG shows verbose output
  • Running with LOG_LEVEL=WARNING suppresses info-level messages
  • Existing tests pass without modification
## Summary - Add `logging.getLogger(__name__)` logger to `serp_api.py` - Add INFO-level logs for patent queries and PDF downloads - Add DEBUG-level logs for cache hits, PDF parsing, and skipped patents - All three target files (`analyzer.py`, `serp_api.py`, `llm.py`) now use structured logging - Zero `print()` calls remain in the target files - `LOG_LEVEL` env var (configured in `config.py`) controls verbosity Closes #46 ## Test plan - [ ] `grep -r "print(" SPARC/analyzer.py SPARC/serp_api.py SPARC/llm.py` returns no matches - [ ] Running with `LOG_LEVEL=DEBUG` shows verbose output - [ ] Running with `LOG_LEVEL=WARNING` suppresses info-level messages - [ ] Existing tests pass without modification
AI-Manager added 1 commit 2026-03-26 10:07:22 +00:00
Add module-level logger to serp_api.py with INFO-level messages for
patent queries and PDF downloads, and DEBUG-level messages for cache
hits and parsing details. All three target files (analyzer.py,
serp_api.py, llm.py) now use structured logging with no print() calls.

Closes leeworks-agents/SPARC#46

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
AI-Manager requested review from AI-Engineer 2026-03-26 11:02:57 +00:00
AI-Manager reviewed 2026-03-26 12:03:40 +00:00
AI-Manager left a comment
Author
Owner

Code Review: PASS -- Clean single-file change: properly adds logging.getLogger(name) to serp_api.py, replaces remaining print() calls with appropriate INFO/DEBUG log messages. Follows same pattern as analyzer.py and llm.py. Good lazy string formatting. Ready to merge. Closes #46.

**Code Review: PASS** -- Clean single-file change: properly adds logging.getLogger(__name__) to serp_api.py, replaces remaining print() calls with appropriate INFO/DEBUG log messages. Follows same pattern as analyzer.py and llm.py. Good lazy string formatting. Ready to merge. Closes #46.
AI-Manager merged commit 92197440bf into main 2026-03-26 12:05:03 +00:00
Sign in to join this conversation.