Skip to content

Observability: Add structured logging across scraper modules #60

Description

@MozzamShahid

File / lines: All src/gmaps_scraper/*.py target modules

Problem: None of scraper.py, place_scraper.py, llm.py, or debug_dump.py import or use the logging module. Errors are either raised, stored in diagnostics, or swallowed. Operators cannot observe mode selection, fallback decisions, retry attempts, consent handling, swallowed HTTP/LLM errors, or timeout budget usage.

Suggested fix:

  1. Add module-level loggers (e.g., logger = logging.getLogger("gmaps_scraper.scraper")).
  2. Emit INFO for mode selection and fallback, WARNING for swallowed transient errors and retries, and ERROR for unrecoverable failures.
  3. Include source_url, resolved_url, and attempt counters in log messages.
  4. Keep log messages off the default stdout JSON output (write to stderr or use Python logging defaults).

Difficulty: medium
Impact: High — dramatically improves incident response and operator observability.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions