Imported getLogger directly from logging module

This was a remainder of some 2.4 compatibility code.
This commit is contained in:
Claude Paroz 2012-09-20 21:03:24 +02:00
parent 89136b2725
commit 26ff2be787
9 changed files with 25 additions and 21 deletions

View File

@ -1,5 +1,6 @@
from __future__ import unicode_literals
import logging
import sys
import types
@ -7,10 +8,9 @@ from django import http
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):

View File

@ -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.handlers import base
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

View File

@ -3,6 +3,7 @@ PostgreSQL database backend for Django.
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.creation import DatabaseCreation
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_type(psycopg2.extensions.UNICODE)
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:

View File

@ -3,15 +3,15 @@ from __future__ import unicode_literals
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):

View File

@ -1,4 +1,5 @@
import hashlib
import logging
import re
from django.conf import settings
@ -6,9 +7,9 @@ from django import http
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):

View File

@ -7,6 +7,7 @@ against request forgeries from other sites.
from __future__ import unicode_literals
import hashlib
import logging
import re
import random
@ -15,10 +16,10 @@ from django.core.urlresolvers import get_callable
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."

View File

@ -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):

View File

@ -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):

View File

@ -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 @@ class AdminEmailHandlerTest(TestCase):
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 @@ class AdminEmailHandlerTest(TestCase):
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 @@ class AdminEmailHandlerTest(TestCase):
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 @@ class AdminEmailHandlerTest(TestCase):
self.assertEqual(len(mail.outbox), 0)
logger = getLogger('django.request')
logger = logging.getLogger('django.request')
logger.error(message)
self.assertEqual(len(mail.outbox), 1)