forked from 0xWheatyz/SPARC
Replace print() calls with structured logging in analyzer.py, serp_api.py, and llm.py #931
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?
Summary
Several backend modules use
print()for diagnostic output. This makes it impossible to control log levels, filter by severity, or forward logs to a centralised log collector.Roadmap Reference
P2 Backend -- Add structured logging (ROADMAP.md)
What to do
loggingconfiguration (e.g. inconfig.pyor a dedicatedlogging_config.py) that sets a default level from theLOG_LEVELenvironment variable (defaultINFO).print()call inanalyzer.py,serp_api.py, andllm.pywith the appropriatelogger.debug(),logger.info(),logger.warning(), orlogger.error()call.logger = logging.getLogger(__name__).logger.exception()in except blocks.Acceptance criteria
print()calls remain inanalyzer.py,serp_api.py, orllm.py.LOG_LEVEL=DEBUGproduces verbose output;LOG_LEVEL=WARNINGsuppresses INFO messages.This issue has been resolved. All three files now use structured logging via
logging.getLogger(__name__):SPARC/analyzer.py,SPARC/serp_api.py, andSPARC/llm.py. Noprint()calls remain. Closing as completed.