Skip to content

Commit

Permalink
Move logger level setting to dandiapi top level module
Browse files Browse the repository at this point in the history
  • Loading branch information
waxlamp committed Jan 2, 2025
1 parent dc3549d commit 78c8827
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 6 additions & 0 deletions dandiapi/__init__.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
from __future__ import annotations

from importlib.metadata import version
import logging

from django.conf import settings

# This project module is imported for us when Django starts. To ensure that Celery app is always
# defined prior to any shared_task definitions (so those tasks will bind to the app), import
# the Celery module here for side effects.
from .celery import app as _celery_app # noqa: F401

__version__ = version('dandiapi')

# Configure the logging level on all DANDI loggers.
logging.getLogger(__name__).setLevel(settings.DANDI_LOG_LEVEL)
3 changes: 0 additions & 3 deletions dandiapi/api/apps.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,6 @@ def ready(self):
import dandiapi.api.checks # noqa: F401, RUF100
import dandiapi.api.signals # noqa: F401

# Configure the logging level on just DANDI loggers.
logging.getLogger(__name__.split('.')[0]).setLevel(settings.DANDI_LOG_LEVEL)

if hasattr(settings, 'SENTRY_DSN'):
sentry_sdk.init(
dsn=settings.SENTRY_DSN,
Expand Down

0 comments on commit 78c8827

Please sign in to comment.