forked from 0xWheatyz/SPARC
Refactor: replace print() calls with structured logging in analyzer.py, serp_api.py, and llm.py #882
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
Multiple backend modules use
print()for output instead of Python'sloggingmodule. This makes it impossible to control log levels, route logs to files, or integrate with log aggregators.Roadmap reference: P2 Backend - Add structured logging
What to do
print()calls inanalyzer.py,serp_api.py, andllm.pywith calls to a named logger (e.g.logging.getLogger(__name__)).api.pystartup that sets level and format based on aLOG_LEVELenvironment variable (default:INFO).print()calls and fix those too.Acceptance criteria
print()calls remain in backend source files (excluding tests).LOG_LEVEL=DEBUGproduces verbose output;LOG_LEVEL=WARNINGsuppresses info logs.This issue has been resolved. The changes are already merged into main.
All print() calls replaced with structured logging (logging.getLogger). No print() calls remain in backend source files.
Closing as completed.