RedisVL warnings are never shown when the application has not configured logging
Maintainer thường phản hồi trong vòng 4 ngà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
- 77/100
Hướng nghiên cứu
Bắt đầu với redisvl/utils/log.py và kiểm tra cách get_logger gắn các handler. Tái hiện hành vi bằng script được cung cấp, cả trước và sau logging.basicConfig(), sau đó kiểm tra các bài kiểm thử liên quan đến cảnh báo về trường vector chưa được phân tích. Công việc hoàn tất khi các cảnh báo của RedisVL được đưa ra stderr qua lastResort mà không cần cấu hình logging, trong khi logging đã cấu hình vẫn hoạt động.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Description
RedisVL's warnings never reach an application that has not configured logging, including the ones that signal lost data.
get_logger attaches a logging.NullHandler to every RedisVL logger (redisvl/utils/log.py). Since Python 3.2, a WARNING or higher record with no handler anywhere in the logger hierarchy goes to logging.lastResort, which prints it to stderr. A NullHandler counts as a handler, so it opts every RedisVL logger out of that fallback and the record is dropped.
That affects every get_logger call site in the library (22 on main). The most consequential is the warning #742 added for a vector field that from_existing cannot parse: the recovered schema is missing that field, and recreating the index from it drops the field. In the issue's own setting, a plain script with no logging configuration, the warning is never shown. The test for it passes only because pytest's caplog installs its own handler.
Reproduction
import logging
from redisvl.utils.log import get_logger
get_logger("redisvl.demo").warning("from redisvl logger")
logging.getLogger("plain.demo").warning("from plain logger")
On main, with Python 3.13, only from plain logger is printed. After logging.basicConfig(), the RedisVL warning appears.
Expected behaviour
With no logging configuration, RedisVL warnings and errors reach stderr through lastResort, as a standard-library logger's do. An application that configures logging is unaffected either way.
Proposed fix
Stop attaching the NullHandler in get_logger. It was only needed to silence the "No handlers could be found" message on Python 2 and early Python 3. It does not configure the root logger, so this keeps the behaviour that #443 and #445 asked for.
- Ngôn ngữ chính
- Python
- Star
- 432
- Fork
- 116
- Merge trung bình
- 5 ngày 22 giờ
- Pull request đã merge (30 ngày)
- 13
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của redis/redis-vl-python
-
from_existing fails on SVS-VAMANA indexes created without compressionCó thể đã có người làm @itsrayeedscodespace đã nhận 1 ngày trước. Đang mởbug index
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
redis/redis-vl-python#787 ·
Maintainer thường phản hồi trong vòng 4 ngày
-
exists() depends on exact FT.INFO error wording; an unrecognised "missing index" message makes create() never create the index (regression from #672)Có thể làm lại được Pull request cho issue này đã bị đóng mà không được merge. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
redis/redis-vl-python#773 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 4 ngày
-
Vector field with index_missing=True cannot be createdCó thể đã có người làm @RaphaelFakhri đã nhận 11 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
redis/redis-vl-python#770 ·
Maintainer thường phản hồi trong vòng 4 ngày
-
Add Python 3.15 supportCó thể đã có người làm @vishal-bala đã nhận 13 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
redis/redis-vl-python#757 · 1 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 4 ngày
-
SearchIndex.drop_keys does not validate cluster hash-tag co-location (inconsistent with drop_documents)Có thể đã có người làm @Hashim1999164 đã nhận 10 ngày trước. Đang mởbug good first issue index
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
redis/redis-vl-python#601 ·
Maintainer thường phản hồi trong vòng 4 ngày
Tất cả issue của redis/redis-vl-python
Issue tương tự
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 4 ngày
-
Add alembic upgrade predeployĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
ClockGU/clockwork-backend#169 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
aws-samples/sample-per-model-bedrock#616 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
chnm/teachinghistory-hugo#47 ·
-
good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 67/100
pandas-dev/pandas-stubs#2047 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày