forked from 0xWheatyz/SPARC
Replace print() calls with structured logging in analyzer.py, serp_api.py, and llm.py #123
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
analyzer.py,serp_api.py, andllm.pyuseprint()for diagnostic output. This makes log level filtering, structured output, and log aggregation (e.g., in Kubernetes) impossible.Work
import loggingand create a module-level logger (logger = logging.getLogger(__name__)) in each of the three files.print()calls with appropriatelogger.info(),logger.warning(), orlogger.error()calls.logging_config.pymodule.LOG_LEVELenvironment variable.Acceptance Criteria
print()calls remain inanalyzer.py,serp_api.py, orllm.py.LOG_LEVEL=DEBUGproduces verbose output;LOG_LEVEL=WARNINGsuppresses info logs.References
Roadmap: P2 — Backend — Add structured logging.
This issue has already been resolved. All three files (
analyzer.py,serp_api.py,llm.py) now use structuredloggingvialogging.getLogger(__name__)instead ofprint()calls.Resolved by PR #29 and PR #54. Closing.