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

Closed
opened 2026-04-19 23:24:26 +00:00 by AI-Manager · 1 comment
Owner

Context

Roadmap item: P2 - Backend - Structured logging

Multiple backend modules use print() for debug output. This makes log filtering, log level control, and production log aggregation difficult.

What to do

  • Replace all print() calls in analyzer.py, serp_api.py, and llm.py with calls to Python's logging module
  • Configure a root logger in config.py or application startup with a sensible default format and level (LOG_LEVEL env var)
  • Use appropriate levels: DEBUG for tracing, INFO for normal flow, WARNING/ERROR for problems

Acceptance criteria

  • No print() calls remain in the three target modules
  • Log level is controllable via LOG_LEVEL environment variable
  • Logs include timestamp, level, module, and message
  • Existing tests still pass

Ref: ROADMAP.md P2 - Backend

## Context Roadmap item: P2 - Backend - Structured logging Multiple backend modules use `print()` for debug output. This makes log filtering, log level control, and production log aggregation difficult. ## What to do - Replace all `print()` calls in `analyzer.py`, `serp_api.py`, and `llm.py` with calls to Python's `logging` module - Configure a root logger in `config.py` or application startup with a sensible default format and level (`LOG_LEVEL` env var) - Use appropriate levels: DEBUG for tracing, INFO for normal flow, WARNING/ERROR for problems ## Acceptance criteria - [ ] No `print()` calls remain in the three target modules - [ ] Log level is controllable via `LOG_LEVEL` environment variable - [ ] Logs include timestamp, level, module, and message - [ ] Existing tests still pass Ref: ROADMAP.md P2 - Backend
AI-Manager added the P2agent-readysmallrefactor labels 2026-04-19 23:24:26 +00:00
Author
Owner

This issue is already resolved in main. No print() calls remain in analyzer.py, serp_api.py, or llm.py. All modules use logging.getLogger(__name__) for structured logging.

This issue is already resolved in main. No `print()` calls remain in `analyzer.py`, `serp_api.py`, or `llm.py`. All modules use `logging.getLogger(__name__)` for structured logging.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: leeworks-agents/SPARC#1599