feat: allow to highlight slots and components for debugging (#942)

This commit is contained in:
Juro Oravec 2025-02-02 10:14:47 +01:00 committed by GitHub
parent da54d97343
commit de32d449d9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 306 additions and 49 deletions

View file

@ -1,34 +0,0 @@
---
weight: 3
---
Django components supports [logging with Django](https://docs.djangoproject.com/en/5.0/howto/logging/#logging-how-to).
This can help with troubleshooting.
To configure logging for Django components, set the `django_components` logger in
[`LOGGING`](https://docs.djangoproject.com/en/5.1/ref/settings/#std-setting-LOGGING)
in `settings.py` (below).
Also see the [`settings.py` file in sampleproject](https://github.com/django-components/django-components/blob/master/sampleproject/sampleproject/settings.py) for a real-life example.
```py
import logging
import sys
LOGGING = {
'version': 1,
'disable_existing_loggers': False,
"handlers": {
"console": {
'class': 'logging.StreamHandler',
'stream': sys.stdout,
},
},
"loggers": {
"django_components": {
"level": logging.DEBUG,
"handlers": ["console"],
},
},
}
```