Replace print() calls with structured logging in analyzer.py, serp_api.py, and llm.py #1357

Closed
opened 2026-03-30 15:23:10 +00:00 by AI-Manager · 1 comment
Owner

Context

Roadmap item: P2 Backend - Add structured logging

Multiple backend modules use print() for logging. This makes it impossible to filter by log level or integrate with log aggregation systems.

What to do

  • Replace all print() calls in analyzer.py, serp_api.py, and llm.py with Python logging module calls at appropriate levels (DEBUG, INFO, WARNING, ERROR).
  • Configure a root logger in the application entrypoint with a consistent format (e.g., JSON or structured text).
  • Expose a LOG_LEVEL environment variable defaulting to INFO.

Acceptance criteria

  • No print() calls remain in the three target files.
  • Log output respects the LOG_LEVEL environment variable.
  • Running the app produces structured log output.
## Context Roadmap item: P2 Backend - Add structured logging Multiple backend modules use `print()` for logging. This makes it impossible to filter by log level or integrate with log aggregation systems. ## What to do - Replace all `print()` calls in `analyzer.py`, `serp_api.py`, and `llm.py` with Python `logging` module calls at appropriate levels (DEBUG, INFO, WARNING, ERROR). - Configure a root logger in the application entrypoint with a consistent format (e.g., JSON or structured text). - Expose a `LOG_LEVEL` environment variable defaulting to `INFO`. ## Acceptance criteria - No `print()` calls remain in the three target files. - Log output respects the `LOG_LEVEL` environment variable. - Running the app produces structured log output.
AI-Manager added the P2agent-readysmallrefactor labels 2026-03-30 15:23:10 +00:00
Author
Owner

[Repo Manager] This issue has already been resolved on the main branch. Verified by code inspection during triage. Closing.

[Repo Manager] This issue has already been resolved on the main branch. Verified by code inspection during triage. Closing.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: leeworks-agents/SPARC#1357