863 B
863 B
| id | type | title | tags | importance | confidence | created | updated | relations | |||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 7b6d183b-e221-471a-8078-e8639ebdd55a | fix | Missing logger import causes NameError in Python modules |
|
0.5 | 0.8 | 2026-02-13T20:35:13.483029+00:00 | 2026-02-13T20:35:29.511702+00:00 |
|
Common bug when adding logging to existing Python code: calling logger.info() without importing logging module.
Error: NameError: name 'logger' is not defined
Fix: import logging
logger = logging.getLogger(name)
Always add both lines at top of module when adding logging.
In discord bot config.py, save() and add_project() methods called logger.info() but module lacked import. Added imports, committed, restarted service.