From 29a25f16dc8abb481edf8cc1274f2c1652cf9a46 Mon Sep 17 00:00:00 2001 From: Mathijs de Bruin Date: Mon, 19 Sep 2011 14:14:35 +0200 Subject: [PATCH] Make a named logger available everywhere we might need it. --- social_auth/backends/__init__.py | 3 +++ social_auth/backends/contrib/foursquare.py | 3 +++ social_auth/backends/contrib/github.py | 3 +++ social_auth/backends/contrib/linkedin.py | 3 +++ social_auth/backends/contrib/livejournal.py | 3 +++ social_auth/backends/contrib/orkut.py | 3 +++ social_auth/backends/facebook.py | 3 +++ social_auth/backends/google.py | 3 +++ social_auth/backends/twitter.py | 3 +++ social_auth/backends/yahoo.py | 3 +++ social_auth/views.py | 3 +++ 11 files changed, 33 insertions(+) diff --git a/social_auth/backends/__init__.py b/social_auth/backends/__init__.py index 8fa45a1..9ec7a5d 100644 --- a/social_auth/backends/__init__.py +++ b/social_auth/backends/__init__.py @@ -9,6 +9,9 @@ Also the modules *must* define a BACKENDS dictionary with the backend name (which is used for URLs matching) and Auth class, otherwise it won't be enabled. """ +import logging +logger = logging.getLogger(__name__) + from os import walk from os.path import basename from uuid import uuid4 diff --git a/social_auth/backends/contrib/foursquare.py b/social_auth/backends/contrib/foursquare.py index f0def0d..86dc7b9 100644 --- a/social_auth/backends/contrib/foursquare.py +++ b/social_auth/backends/contrib/foursquare.py @@ -1,3 +1,6 @@ +import logging +logger = logging.getLogger(__name__) + import urllib from django.utils import simplejson diff --git a/social_auth/backends/contrib/github.py b/social_auth/backends/contrib/github.py index 124bc22..b24462a 100644 --- a/social_auth/backends/contrib/github.py +++ b/social_auth/backends/contrib/github.py @@ -11,6 +11,9 @@ setting, it must be a list of values to request. By default account id and token expiration time are stored in extra_data field, check OAuthBackend class for details on how to extend it. """ +import logging +logger = logging.getLogger(__name__) + import cgi import urllib diff --git a/social_auth/backends/contrib/linkedin.py b/social_auth/backends/contrib/linkedin.py index 72740f5..00ac92b 100644 --- a/social_auth/backends/contrib/linkedin.py +++ b/social_auth/backends/contrib/linkedin.py @@ -3,6 +3,9 @@ Linkedin OAuth support No extra configurations are needed to make this work. """ +import logging +logger = logging.getLogger(__name__) + from xml.etree import ElementTree from xml.parsers.expat import ExpatError diff --git a/social_auth/backends/contrib/livejournal.py b/social_auth/backends/contrib/livejournal.py index ce9e538..b5ca7e0 100644 --- a/social_auth/backends/contrib/livejournal.py +++ b/social_auth/backends/contrib/livejournal.py @@ -4,6 +4,9 @@ LiveJournal OpenID support. This contribution adds support for LiveJournal OpenID service in the form username.livejournal.com. Username is retrieved from the identity url. """ +import logging +logger = logging.getLogger(__name__) + import urlparse from social_auth.backends import OpenIDBackend, OpenIdAuth, USERNAME diff --git a/social_auth/backends/contrib/orkut.py b/social_auth/backends/contrib/orkut.py index 9b06698..ce3ef06 100644 --- a/social_auth/backends/contrib/orkut.py +++ b/social_auth/backends/contrib/orkut.py @@ -10,6 +10,9 @@ can be specified by defining ORKUT_EXTRA_DATA setting. OAuth settings ORKUT_CONSUMER_KEY and ORKUT_CONSUMER_SECRET are needed to enable this service support. """ +import logging +logger = logging.getLogger(__name__) + import urllib from django.conf import settings diff --git a/social_auth/backends/facebook.py b/social_auth/backends/facebook.py index 661bc47..5aff9ed 100644 --- a/social_auth/backends/facebook.py +++ b/social_auth/backends/facebook.py @@ -11,6 +11,9 @@ setting, it must be a list of values to request. By default account id and token expiration time are stored in extra_data field, check OAuthBackend class for details on how to extend it. """ +import logging +logger = logging.getLogger(__name__) + import cgi from urllib import urlencode from urllib2 import urlopen diff --git a/social_auth/backends/google.py b/social_auth/backends/google.py index 52f701f..621327f 100644 --- a/social_auth/backends/google.py +++ b/social_auth/backends/google.py @@ -13,6 +13,9 @@ APIs console https://code.google.com/apis/console/ Identity option. OpenID also works straightforward, it doesn't need further configurations. """ +import logging +logger = logging.getLogger(__name__) + from urllib import urlencode from urllib2 import Request, urlopen diff --git a/social_auth/backends/twitter.py b/social_auth/backends/twitter.py index 8f87cf8..403a808 100644 --- a/social_auth/backends/twitter.py +++ b/social_auth/backends/twitter.py @@ -11,6 +11,9 @@ User screen name is used to generate username. By default account id is stored in extra_data field, check OAuthBackend class for details on how to extend it. """ +import logging +logger = logging.getLogger(__name__) + from django.utils import simplejson from social_auth.backends import ConsumerBasedOAuth, OAuthBackend, USERNAME diff --git a/social_auth/backends/yahoo.py b/social_auth/backends/yahoo.py index e9362f4..e17577e 100644 --- a/social_auth/backends/yahoo.py +++ b/social_auth/backends/yahoo.py @@ -3,6 +3,9 @@ Yahoo OpenID support No extra configurations are needed to make this work. """ +import logging +logger = logging.getLogger(__name__) + from social_auth.backends import OpenIDBackend, OpenIdAuth diff --git a/social_auth/views.py b/social_auth/views.py index 45afdf2..43442f7 100644 --- a/social_auth/views.py +++ b/social_auth/views.py @@ -5,6 +5,9 @@ Notes: on third party providers that (if using POST) won't be sending crfs token back. """ +import logging +logger = logging.getLogger(__name__) + from functools import wraps from django.conf import settings -- 2.39.5