forked from 0xWheatyz/SPARC
Replace print() calls with structured Python logging in analyzer.py, serp_api.py, and llm.py #362
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?
Problem
analyzer.py,serp_api.py, andllm.pyuseprint()for diagnostic output. This makes it impossible to control log levels, filter by severity, or integrate with centralised log aggregation (e.g., Loki, Datadog).Work
import loggingand create a module-level logger (logger = logging.getLogger(__name__)) in each of the three files.print()calls with appropriatelogger.debug(),logger.info(),logger.warning(), orlogger.error()calls.api.py) with a sensible default format and level.LOG_LEVELenvironment variable to override the default level at runtime.Acceptance Criteria
print()calls remain inanalyzer.py,serp_api.py, orllm.py.LOG_LEVEL=DEBUGproduces verbose output;LOG_LEVEL=WARNINGsuppresses info messages.Reference
Roadmap item: P2 Backend — Add structured logging.
[Triage] Already implemented in main. All print() calls have been replaced with structured logging using logging.getLogger(name) across analyzer.py, serp_api.py, llm.py, and other modules. Closing as resolved.