forked from 0xWheatyz/SPARC
Replace print() calls with structured logging in analyzer, serp_api, and llm modules #644
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 output. This makes it impossible to filter by log level, route logs to structured sinks, or silence verbose output in tests.What to do
loggingand create a module-level logger in each of the three files:logger = logging.getLogger(__name__)print()calls with appropriate log levels (logger.debug,logger.info,logger.warning,logger.error)main.pyorconfig.py(format, level controlled byLOG_LEVELenv var, defaulting toINFO)logger.exception(...)to include stack tracesAcceptance criteria
print()calls remain inanalyzer.py,serp_api.py, orllm.pyLOG_LEVEL=DEBUGproduces verbose output;LOG_LEVEL=WARNINGsuppresses info messagesClosing as already implemented. All modules (
analyzer.py,serp_api.py,llm.py,storage.py,scheduler.py,webhooks.py) uselogging.getLogger(__name__)with structured logging. Noprint()calls remain in the codebase.