AOSSIE-Org / AOSSIE-Org/PictoPy

BUG: Inconsistent Logger Usage Across Backend Modules

Ouverte
#1,515 2 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
bug enhancement possible-duplicate
Langage dominant
Python
Étoiles
283
Forks
679
Merge moyen
7 j 2 h
PR mergées (30 j)
3

Description

### 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

Guide de contribution

Ouvrir le guide de contribution

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.