forked from 0xWheatyz/SPARC
Replace print() calls with structured logging in analyzer.py, serp_api.py, and llm.py #1272
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
Multiple backend modules use
print()for diagnostic output. This prevents log-level filtering, structured formatting, and centralised log aggregation.Roadmap reference: P2 - Backend: Add structured logging
What to do
loggingconfiguration module (e.g.,backend/logging_config.py) that sets up a root logger with a consistent format (timestamp, level, module, message) configurable viaLOG_LEVELenv var.print()calls inanalyzer.py,serp_api.py, andllm.pywithlogger = logging.getLogger(__name__)and appropriate levels (debug,info,warning,error).Acceptance criteria
print()calls remain in the three target files.LOG_LEVEL=DEBUGemits verbose output;LOG_LEVEL=WARNINGsuppresses info messages.Triage: Already Implemented
Structured logging is fully implemented on
main:print()calls remain inanalyzer.py,serp_api.py, orllm.py.SPARC/config.pyconfigureslogging.basicConfig()with a structured format (%(asctime)s %(levelname)s %(name)s %(message)s) and readsLOG_LEVELfrom the environment.logging.getLogger(__name__)for output.Closing as completed.