AOSSIE-Org / AOSSIE-Org/PictoPy

BUG: Inconsistent Logger Usage Across Backend Modules

Đang mở
#1,515 2 bình luận 0 reaction 0 người được giao Xem trên GitHub
bug enhancement possible-duplicate
Ngôn ngữ chính
Python
Star
283
Fork
679
Merge trung bình
7 ngày 2 giờ
Pull request đã merge (30 ngày)
3

Mô tả

### Is there an existing issue for this?

- [x] I have searched the existing issues

### What happened?

Three modules use Python's stdlib logging.getLogger directly instead of the project's own get_logger from app.logging.setup_logging. This means their log output bypasses the ColorFormatter, component-level prefixes, and environment-level filtering configured in setup_logging.py.

### Affected files

| File | Problem |
|------|---------|
| `backend/app/utils/images.py` | `get_logger` assigned correctly on line 35, then **silently overwritten** by `logging.getLogger` on line 41 |
| `backend/app/routes/face_clusters.py` | Uses `logging.getLogger` directly; all 7 sibling route files use `get_logger` |
| `backend/app/routes/models.py` | Uses `logging.getLogger` directly; all 7 sibling route files use `get_logger` |

### Root Cause

`images.py` has a duplicate logger definition the second one overwrites the
first:

```python
# Line 35 — correct
logger = get_logger(__name__)

# Line 41 — overwrites the above, bypassing all custom setup
logger = logging.getLogger(__name__)
```

`face_clusters.py` and `models.py` simply never adopted the project logger
pattern that every other route module follows.

### Record

- [x] I agree to follow this project's Code of Conduct

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

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.