Change logging imports and commands

Now uses `get_extension_logger` as is recommanded by https://allianceauth.readthedocs.io/en/v4.4.2/development/custom/logging.html
This commit is contained in:
r0kym 2024-11-15 15:12:03 +01:00
parent 164cd4fbb2
commit 8d63801b00

View File

@ -40,10 +40,10 @@ Please use the following approach to ensure your tasks are working properly with
Here is an example implementation of a task: Here is an example implementation of a task:
```python ```python
import logging from allianceauth.services.hooks import get_extension_logger
from celery import shared_task from celery import shared_task
logger = logging.getLogger(__name__) logger = get_extension_logger(__name__)
@shared_task @shared_task
@ -80,10 +80,10 @@ However, many long-running tasks consist of several smaller processes that need
Example implementation for a celery chain: Example implementation for a celery chain:
```python ```python
import logging from allianceauth.services.hooks import get_extension_logger
from celery import shared_task, chain from celery import shared_task, chain
logger = logging.getLogger(__name__) logger = get_extension_logger(__name__)
@shared_task @shared_task