Skip to content

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

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions