Skip to content

Consolidate logging.basicConfig() calls to a single entry point #549

@gkorland

Description

@gkorland

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

  1. Keep a single logging.basicConfig() call in api/index.py (the application entry point).
  2. In other modules, use logger = logging.getLogger(__name__) without calling basicConfig().

Context

Found during code review of PR #522.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions