Replace logging.basicConfig() with something more sensible

Đang mở
#254 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
55/100
Loại issue
Tái cấu trúc
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
python
Lĩnh vực
backend, observability

Hướng nghiên cứu

Find where logging.basicConfig() runs in api.server and inspect the executable entrypoint in main.py. Check how the service is started and how tests or ASGI imports configure logging; the issue suggests moving configuration to main.py or guarding it when handlers already exist. Done means importing api.server no longer overrides logging configured by its host process.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

logging.basicConfig(...) is executed at module import time, which can override/lock in logging configuration for any process that imports api.server (including tests and ASGI servers). Consider moving logging configuration to the executable entrypoint (e.g., main.py) or only configuring if no handlers are present, to avoid side effects for library consumers.

if not logging.getLogger().hasHandlers():
    logging.basicConfig(level=os.getenv("LOGLEVEL", logging.INFO))

Originally posted by @Copilot in #253

Ngôn ngữ chính
Python
Star
5
Fork
4
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

  • Có Dockerfile hoặc tệp Docker Compose
  • Không có mẫu pull request
  • Không có hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của NCATSTranslator/NameResolution

Tất cả issue của NCATSTranslator/NameResolution

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.