AOSSIE-Org / AOSSIE-Org/PictoPy

BUG: Inconsistent Logger Usage Across Backend Modules

Abierto
#1,515 2 comentarios 0 reacciones 0 asignados Ver en GitHub
bug enhancement possible-duplicate
Lenguaje dominante
Python
Estrellas
283
Forks
679
Merge medio
7 d 2 h
PR fusionados (30 d)
3

Descripción

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

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.