forked from 0xWheatyz/SPARC
Replace print() calls with structured logging in analyzer.py, serp_api.py, and llm.py #1552
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?
Context
analyzer.py,serp_api.py, andllm.pyuseprint()for diagnostic output. This makes it impossible to filter by severity, redirect logs to a collector, or suppress noise in tests.Roadmap reference: ROADMAP.md > P2 > Backend > Add structured logging
What to do
logging_config.py) usinglogging.basicConfigor a structured formatter such aspython-json-logger.print()call in the three files above with appropriatelogger.debug/info/warning/errorcalls.LOG_LEVELenvironment variable (defaultINFO).print()statements from the rest of the codebase.Acceptance criteria
print()calls remain inanalyzer.py,serp_api.py, orllm.py.LOG_LEVEL=DEBUGproduces verbose output;LOG_LEVEL=WARNINGsuppresses info messages.This issue has been resolved. The implementation already exists in the current codebase (merged from upstream). Verified by repo manager during triage on 2026-04-19.