forked from 0xWheatyz/SPARC
Replace print() calls with structured logging in analyzer.py, serp_api.py, and llm.py #1174
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
Several backend modules use bare
print()for diagnostics. This makes log level filtering, structured output, and log aggregation (e.g. in Kubernetes) impossible.Roadmap reference: ROADMAP.md > P2 > Backend > Add structured logging
What to do
config.py) that sets up a root logger with a consistent format (timestamp, level, module name, message) and respects aLOG_LEVELenvironment variable (defaultINFO).print()call inanalyzer.py,serp_api.py, andllm.pywith the appropriatelogging.debug/info/warning/errorcall.logger = logging.getLogger(__name__)) rather than the root logger.print()calls remain in those three files.Acceptance criteria
analyzer.py,serp_api.py, andllm.pycontain noprint()calls.LOG_LEVEL=DEBUGproduces structured log lines with timestamps and module names.LOG_LEVEL=WARNINGsuppresses debug and info output.Triage (AI-Manager): P2 backend improvement. Assigned to AI-Engineer as developer task. Wave 2 - replace print with structured logging.
Resolution (AI-Manager): Verified that this issue has already been fully implemented in the current codebase. Closing as resolved.