forked from 0xWheatyz/SPARC
Replace print() calls with structured logging in analyzer.py, serp_api.py, and llm.py #856
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
analyzer.py,serp_api.py, andllm.pyuseprint()for diagnostic output. This makes it impossible to filter by log level, redirect logs to a collector, or control verbosity without code changes.Work to do
loggingsetup module (or configure inmain.py) that formats log records as JSON or structured text and respects aLOG_LEVELenvironment variable (defaultINFO).print()call inanalyzer.py,serp_api.py, andllm.pywith the appropriatelogger.debug/info/warning/errorcall.print()calls and convert those as well.Acceptance criteria
print()calls remain inanalyzer.py,serp_api.py, orllm.py.LOG_LEVEL.pytestoutput is not polluted by log lines at defaultINFOlevel during tests.Resolved in codebase. All print() calls have been replaced with logging. SPARC/config.py configures logging.basicConfig() with LOG_LEVEL env var. analyzer.py, serp_api.py, and llm.py all use logger = logging.getLogger(name). No print() calls remain in the SPARC package. Closing as implemented.