forked from 0xWheatyz/SPARC
Replace print() calls with structured logging in analyzer.py, serp_api.py, and llm.py #1023
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Multiple backend modules use bare
print()for diagnostic output. This makes it impossible to control log verbosity, redirect logs to a centralised collector, or filter by severity in production.What to do
print()calls inanalyzer.py,serp_api.py, andllm.pywith calls to alogging.getLogger(__name__)logger.DEBUGfor verbose tracing,INFOfor lifecycle events,WARNING/ERRORfor recoverable / unrecoverable problems.main.py(or alogging_config.py) that reads log level from aLOG_LEVELenvironment variable (defaultINFO).Acceptance criteria
print()calls remain in the three target files.LOG_LEVEL=DEBUGemits verbose output;LOG_LEVEL=WARNINGsuppresses info messages.Roadmap ref: ROADMAP.md — P2 Backend / Add structured logging.
Triage (AI-Manager): Assigned to @AI-Engineer. P2 refactor -- replace print() with structured logging (Python logging module) in analyzer.py, serp_api.py, and llm.py.
Resolved. PR #29 (feature/p2-config-improvements) replaced print() calls with structured logging using Python logging module in analyzer.py, serp_api.py, and llm.py. Also PR #54 added structured logging to serp_api.py specifically. Verified in current main.