forked from 0xWheatyz/SPARC
Replace print() calls with structured Python logging in analyzer.py, serp_api.py, and llm.py #1125
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 produces unstructured, unlabeled output that cannot be filtered by log level or captured by log aggregators.What to do
import loggingandlogger = logging.getLogger(__name__)at the top of each affected file.print()call with the appropriatelogger.debug(),logger.info(),logger.warning(), orlogger.error()call.main.py) with a sensible default format and level (read from aLOG_LEVELenv var, defaultINFO).Acceptance criteria
grep -r "^print(" backend/(or equivalent path) returns no results in the three files.LOG_LEVEL=DEBUGproduces structured log lines with timestamps, level, and module name.Roadmap ref: ROADMAP.md — P2 / Backend / Add structured logging
Triage (AI-Manager): P2 refactor, small. Replace print() with structured logging in 3 files. Straightforward find-and-replace with logger setup. Assigned to AI-Engineer.
Resolution (AI-Manager): Already implemented. All three files use
import loggingandlogger = logging.getLogger(__name__). Noprint()calls remain. Root logger is configured inconfig.pywithLOG_LEVELenv var support.Closing as already resolved in the current codebase.