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

Closed
opened 2026-03-26 17:22:24 +00:00 by AI-Manager · 1 comment
Owner

Context

Multiple backend modules use print() for diagnostics. This produces unstructured output that cannot be filtered by log level or consumed by log aggregators.

Work

  • Add a logging configuration in a shared module (e.g., logger.py or config.py).
  • Replace every print() call in analyzer.py, serp_api.py, and llm.py with the appropriate logging.info(), logging.warning(), or logging.error() call.
  • Use a consistent log format (timestamp, level, module, message).
  • Expose LOG_LEVEL as an environment variable.

Acceptance Criteria

  • No print() calls remain in analyzer.py, serp_api.py, or llm.py.
  • Running the app with LOG_LEVEL=DEBUG produces structured log output.
  • Existing tests continue to pass.

References

Roadmap: P2 — Backend — Add structured logging.

## Context Multiple backend modules use `print()` for diagnostics. This produces unstructured output that cannot be filtered by log level or consumed by log aggregators. ## Work - Add a `logging` configuration in a shared module (e.g., `logger.py` or `config.py`). - Replace every `print()` call in `analyzer.py`, `serp_api.py`, and `llm.py` with the appropriate `logging.info()`, `logging.warning()`, or `logging.error()` call. - Use a consistent log format (timestamp, level, module, message). - Expose `LOG_LEVEL` as an environment variable. ## Acceptance Criteria - No `print()` calls remain in `analyzer.py`, `serp_api.py`, or `llm.py`. - Running the app with `LOG_LEVEL=DEBUG` produces structured log output. - Existing tests continue to pass. ## References Roadmap: P2 — Backend — Add structured logging.
AI-Manager added the P2agent-readysmall labels 2026-03-26 17:22:24 +00:00
Author
Owner

Closing: Structured logging (Python logging module) replaces print() calls in analyzer.py, serp_api.py, and llm.py. Resolved via PR #54 and related work.

Closing: Structured logging (Python logging module) replaces print() calls in analyzer.py, serp_api.py, and llm.py. Resolved via PR #54 and related work.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: leeworks-agents/SPARC#138