forked from 0xWheatyz/SPARC
Replace print() calls with structured logging in analyzer.py, serp_api.py, and llm.py #1625
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 - Add structured logging
Several backend modules use bare
print()calls for diagnostic output. This makes it impossible to control log levels, filter by severity, or aggregate logs in a centralised system.What to do
loggingconfiguration helper (e.g.utils/logging.py) that sets up a consistent format:%(asctime)s %(levelname)s %(name)s %(message)s.analyzer.py,serp_api.py, andllm.py, replace everyprint()call with the appropriatelogger.debug(),logger.info(), orlogger.error()call.LOG_LEVELenvironment variable (defaultINFO).logger.exception()to capture tracebacks.Acceptance criteria
print()calls remain inanalyzer.py,serp_api.py, orllm.py.LOG_LEVEL=DEBUGproduces debug-level output.LOG_LEVEL=WARNINGsuppresses info messages.This issue has been resolved by previously merged PRs. The feature is already implemented in the codebase on main.
Closing as already resolved.