Description
logging.basicConfig() is called in 8 separate modules under api/:
api/index.py:22
api/graph.py:9
api/project.py:16
api/analyzers/source_analyzer.py:21
api/git_utils/git_graph.py:9
api/git_utils/git_utils.py:15
api/info.py:7
api/llm.py:23
Only the first call to logging.basicConfig() takes effect (subsequent calls are silently ignored unless force=True is passed). This means the log configuration depends on whichever module is imported first, leading to unpredictable behavior.
Suggested Fix
- Keep a single
logging.basicConfig() call in api/index.py (the application entry point).
- In other modules, use
logger = logging.getLogger(__name__) without calling basicConfig().
Context
Found during code review of PR #522.