-
Notifications
You must be signed in to change notification settings - Fork 41
Expand file tree
/
Copy pathapps.py
More file actions
26 lines (17 loc) · 841 Bytes
/
apps.py
File metadata and controls
26 lines (17 loc) · 841 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
from django.apps import AppConfig
from .app_settings import app_settings
class DjangoStructLogConfig(AppConfig):
name = "django_structlog"
def ready(self) -> None:
if app_settings.CELERY_ENABLED:
from .celery.receivers import CeleryReceiver
self._celery_receiver = CeleryReceiver()
self._celery_receiver.connect_signals()
if app_settings.COMMAND_LOGGING_ENABLED:
from .commands import DjangoCommandReceiver
self._django_command_receiver = DjangoCommandReceiver()
self._django_command_receiver.connect_signals()
if app_settings.DJANGO_TASKS_ENABLED:
from .tasks.receivers import DjangoTaskReceiver
self._django_task_receiver = DjangoTaskReceiver()
self._django_task_receiver.connect_signals()