forked from 0xWheatyz/SPARC
Replace print() calls with structured Python logging in analyzer.py, serp_api.py, and llm.py #1503
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
Roadmap item: P2 Backend — structured logging
analyzer.py,serp_api.py, andllm.pyuseprint()for diagnostic output. This bypasses Python's logging framework, making it impossible to control log levels, filter output, or integrate with log aggregators.What to do
import loggingandlogger = logging.getLogger(__name__)at the top of each affected module.print()call with the appropriate log level:logger.debug()for verbose trace output,logger.info()for normal flow events,logger.warning()for recoverable issues,logger.error()for failures.api.pyor a dedicatedlogging_config.py(level fromLOG_LEVELenv var, defaultINFO).docker compose upstill shows meaningful log output.Acceptance criteria
print()calls remain inanalyzer.py,serp_api.py, orllm.pyLOG_LEVELenvironment variable[Repo Manager] This issue is already resolved. All Python modules (
analyzer.py,serp_api.py,llm.py,webhooks.py,scheduler.py) uselogging.getLogger(__name__)and theloggerinstance. Noprint()calls remain in the SPARC package. Closing as complete.