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.
Description
logging.basicConfig()is called in 8 separate modules underapi/:api/index.py:22api/graph.py:9api/project.py:16api/analyzers/source_analyzer.py:21api/git_utils/git_graph.py:9api/git_utils/git_utils.py:15api/info.py:7api/llm.py:23Only the first call to
logging.basicConfig()takes effect (subsequent calls are silently ignored unlessforce=Trueis passed). This means the log configuration depends on whichever module is imported first, leading to unpredictable behavior.Suggested Fix
logging.basicConfig()call inapi/index.py(the application entry point).logger = logging.getLogger(__name__)without callingbasicConfig().Context
Found during code review of PR #522.