Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Imported getLogger directly from logging module

This was a remainder of some 2.4 compatibility code.
  • Loading branch information...
commit 26ff2be787d3c1fad2df4a009fa05b4c11b8cf30 1 parent 89136b2
Claude Paroz claudep authored
4 django/core/handlers/base.py
View
@@ -1,5 +1,6 @@
from __future__ import unicode_literals
+import logging
import sys
import types
@@ -7,10 +8,9 @@
from django.core import signals
from django.utils.encoding import force_text
from django.utils.importlib import import_module
-from django.utils.log import getLogger
from django.utils import six
-logger = getLogger('django.request')
+logger = logging.getLogger('django.request')
class BaseHandler(object):
4 django/core/handlers/wsgi.py
View
@@ -1,5 +1,6 @@
from __future__ import unicode_literals
+import logging
import sys
from io import BytesIO
from threading import Lock
@@ -10,9 +11,8 @@
from django.core.urlresolvers import set_script_prefix
from django.utils import datastructures
from django.utils.encoding import force_str, force_text, iri_to_uri
-from django.utils.log import getLogger
-logger = getLogger('django.request')
+logger = logging.getLogger('django.request')
# See http://www.iana.org/assignments/http-status-codes
4 django/db/backends/postgresql_psycopg2/base.py
View
@@ -3,6 +3,7 @@
Requires psycopg 2: http://initd.org/projects/psycopg2
"""
+import logging
import sys
from django.db import utils
@@ -14,7 +15,6 @@
from django.db.backends.postgresql_psycopg2.version import get_version
from django.db.backends.postgresql_psycopg2.introspection import DatabaseIntrospection
from django.utils.encoding import force_str
-from django.utils.log import getLogger
from django.utils.safestring import SafeText, SafeBytes
from django.utils import six
from django.utils.timezone import utc
@@ -33,7 +33,7 @@
psycopg2.extensions.register_adapter(SafeBytes, psycopg2.extensions.QuotedString)
psycopg2.extensions.register_adapter(SafeText, psycopg2.extensions.QuotedString)
-logger = getLogger('django.db.backends')
+logger = logging.getLogger('django.db.backends')
def utc_tzinfo_factory(offset):
if offset != 0:
4 django/db/backends/util.py
View
@@ -3,15 +3,15 @@
import datetime
import decimal
import hashlib
+import logging
from time import time
from django.conf import settings
from django.utils.encoding import force_bytes
-from django.utils.log import getLogger
from django.utils.timezone import utc
-logger = getLogger('django.db.backends')
+logger = logging.getLogger('django.db.backends')
class CursorWrapper(object):
5 django/middleware/common.py
View
@@ -1,4 +1,5 @@
import hashlib
+import logging
import re
from django.conf import settings
@@ -6,9 +7,9 @@
from django.core.mail import mail_managers
from django.utils.http import urlquote
from django.core import urlresolvers
-from django.utils.log import getLogger
-logger = getLogger('django.request')
+
+logger = logging.getLogger('django.request')
class CommonMiddleware(object):
5 django/middleware/csrf.py
View
@@ -7,6 +7,7 @@
from __future__ import unicode_literals
import hashlib
+import logging
import re
import random
@@ -15,10 +16,10 @@
from django.utils.cache import patch_vary_headers
from django.utils.encoding import force_text
from django.utils.http import same_origin
-from django.utils.log import getLogger
from django.utils.crypto import constant_time_compare, get_random_string
-logger = getLogger('django.request')
+
+logger = logging.getLogger('django.request')
REASON_NO_REFERER = "Referer checking failed - no Referer."
REASON_BAD_REFERER = "Referer checking failed - %s does not match %s."
4 django/views/decorators/http.py
View
@@ -2,18 +2,18 @@
Decorators for views based on HTTP headers.
"""
+import logging
from calendar import timegm
from functools import wraps
from django.utils.decorators import decorator_from_middleware, available_attrs
from django.utils.http import http_date, parse_http_date_safe, parse_etags, quote_etag
-from django.utils.log import getLogger
from django.middleware.http import ConditionalGetMiddleware
from django.http import HttpResponseNotAllowed, HttpResponseNotModified, HttpResponse
conditional_page = decorator_from_middleware(ConditionalGetMiddleware)
-logger = getLogger('django.request')
+logger = logging.getLogger('django.request')
def require_http_methods(request_method_list):
5 django/views/generic/base.py
View
@@ -1,14 +1,15 @@
from __future__ import unicode_literals
+import logging
from functools import update_wrapper
+
from django import http
from django.core.exceptions import ImproperlyConfigured
from django.template.response import TemplateResponse
-from django.utils.log import getLogger
from django.utils.decorators import classonlymethod
from django.utils import six
-logger = getLogger('django.request')
+logger = logging.getLogger('django.request')
class ContextMixin(object):
11 tests/regressiontests/logging_tests/tests.py
View
@@ -1,13 +1,14 @@
from __future__ import unicode_literals
import copy
+import logging
import warnings
from django.conf import compat_patch_logging_config
from django.core import mail
from django.test import TestCase, RequestFactory
from django.test.utils import override_settings
-from django.utils.log import CallbackFilter, RequireDebugFalse, getLogger
+from django.utils.log import CallbackFilter, RequireDebugFalse
# logging config prior to using filter with mail_admins
@@ -153,7 +154,7 @@ def test_accepts_args(self):
token1 = 'ping'
token2 = 'pong'
- logger = getLogger('django.request')
+ logger = logging.getLogger('django.request')
admin_email_handler = self.get_admin_email_handler(logger)
# Backup then override original filters
orig_filters = admin_email_handler.filters
@@ -184,7 +185,7 @@ def test_accepts_args_and_request(self):
token1 = 'ping'
token2 = 'pong'
- logger = getLogger('django.request')
+ logger = logging.getLogger('django.request')
admin_email_handler = self.get_admin_email_handler(logger)
# Backup then override original filters
orig_filters = admin_email_handler.filters
@@ -222,7 +223,7 @@ def test_subject_accepts_newlines(self):
self.assertEqual(len(mail.outbox), 0)
- logger = getLogger('django.request')
+ logger = logging.getLogger('django.request')
logger.error(message)
self.assertEqual(len(mail.outbox), 1)
@@ -247,7 +248,7 @@ def test_truncate_subject(self):
self.assertEqual(len(mail.outbox), 0)
- logger = getLogger('django.request')
+ logger = logging.getLogger('django.request')
logger.error(message)
self.assertEqual(len(mail.outbox), 1)
Please sign in to comment.
Something went wrong with that request. Please try again.