summaryrefslogtreecommitdiff
path: root/django/conf/__init__.py
diff options
context:
space:
mode:
authorClaude Paroz <claude@2xlibre.net>2013-12-31 12:28:01 +0100
committerClaude Paroz <claude@2xlibre.net>2013-12-31 18:35:00 +0100
commitb8e3373f458aa363d59c61b58be390a5a1156467 (patch)
treee2805d1eff7056999c5cf46b6c4c088fbae8d790 /django/conf/__init__.py
parent1d23d766ab85301eb527629400933fd601355f1a (diff)
Fixed #21714 -- Moved logging configuration to global setup()
Thanks Aymeric Augustin for the report and the review.
Diffstat (limited to 'django/conf/__init__.py')
-rw-r--r--django/conf/__init__.py27
1 files changed, 0 insertions, 27 deletions
diff --git a/django/conf/__init__.py b/django/conf/__init__.py
index 3449368cb0..e10d4b1afb 100644
--- a/django/conf/__init__.py
+++ b/django/conf/__init__.py
@@ -7,16 +7,12 @@ a list of all possible variables.
"""
import importlib
-import logging
import os
-import sys
import time # Needed for Windows
-import warnings
from django.conf import global_settings
from django.core.exceptions import ImproperlyConfigured
from django.utils.functional import LazyObject, empty
-from django.utils.module_loading import import_by_path
from django.utils import six
ENVIRONMENT_VARIABLE = "DJANGO_SETTINGS_MODULE"
@@ -44,34 +40,12 @@ class LazySettings(LazyObject):
% (desc, ENVIRONMENT_VARIABLE))
self._wrapped = Settings(settings_module)
- self._configure_logging()
def __getattr__(self, name):
if self._wrapped is empty:
self._setup(name)
return getattr(self._wrapped, name)
- def _configure_logging(self):
- """
- Setup logging from LOGGING_CONFIG and LOGGING settings.
- """
- if not sys.warnoptions:
- # Route warnings through python logging
- logging.captureWarnings(True)
- # Allow DeprecationWarnings through the warnings filters
- warnings.simplefilter("default", DeprecationWarning)
-
- if self.LOGGING_CONFIG:
- from django.utils.log import DEFAULT_LOGGING
- # First find the logging configuration function ...
- logging_config_func = import_by_path(self.LOGGING_CONFIG)
-
- logging_config_func(DEFAULT_LOGGING)
-
- # ... then invoke it with the logging settings
- if self.LOGGING:
- logging_config_func(self.LOGGING)
-
def configure(self, default_settings=global_settings, **options):
"""
Called to manually configure the settings. The 'default_settings'
@@ -84,7 +58,6 @@ class LazySettings(LazyObject):
for name, value in options.items():
setattr(holder, name, value)
self._wrapped = holder
- self._configure_logging()
@property
def configured(self):