forked from 0xWheatyz/SPARC
Refactor: replace print() calls in analyzer.py, serp_api.py, and llm.py with structured logging #1342
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?
Background
analyzer.py,serp_api.py, andllm.pyuseprint()for diagnostic output. This makes it impossible to control log levels, filter output, or integrate with log aggregators in production.What to do
print()calls in the three listed modules with calls to Pythonsloggingmodule.logger = logging.getLogger(__name__).main.pyorapi.py) with a consistent format (timestamp, level, module, message).DEBUGfor verbose trace output,INFOfor normal flow,WARNINGfor recoverable issues,ERROR/EXCEPTIONfor failures.LOG_LEVELenvironment variable.Acceptance criteria
print()calls remain inanalyzer.py,serp_api.py, orllm.py.LOG_LEVEL=DEBUGshows verbose output;LOG_LEVEL=WARNINGsuppresses info messages.References
Roadmap: P2 — Backend — Add structured logging.
Triage (Repo Manager):
Priority: P2
Delegated to: @developer
Rationale: P2 Refactor - small. Replace print() with logging module in analyzer.py, serp_api.py, llm.py. Mechanical change.
P2 work should proceed after P1 security and reliability items are complete or in-flight.
Triaged by repo manager: Already resolved.
grep -c print( analyzer.py serp_api.py llm.pyreturns 0 matches across all three files. All logging uses theloggingmodule. Closing.