summaryrefslogtreecommitdiff
path: root/oauthlib/__init__.py
diff options
context:
space:
mode:
authorIb Lundgren <ib.lundgren@gmail.com>2014-09-24 14:52:53 +0100
committerIb Lundgren <ib.lundgren@gmail.com>2014-09-24 14:52:53 +0100
commitedab385f951e38d65a25003f193793b63037bdec (patch)
tree0c5658eacb8aeca13556314cd0cffdf1db88f5c9 /oauthlib/__init__.py
parent3bb2bfbb593386169e997e3332b236c077a546db (diff)
downloadoauthlib-edab385f951e38d65a25003f193793b63037bdec.tar.gz
Change logging namespace to a tiered one.
Rather than have all logging under oauthlib we now have it per file using __name__. Users who wish to enable or disable all logging can still do so by enabling or disabling the oauthlib logging namespace.
Diffstat (limited to 'oauthlib/__init__.py')
-rw-r--r--oauthlib/__init__.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/oauthlib/__init__.py b/oauthlib/__init__.py
index b043a5a..c70b46a 100644
--- a/oauthlib/__init__.py
+++ b/oauthlib/__init__.py
@@ -11,3 +11,14 @@
__author__ = 'Idan Gazit <idan@gazit.me>'
__version__ = '0.6.3'
+
+
+import logging
+try: # Python 2.7+
+ from logging import NullHandler
+except ImportError:
+ class NullHandler(logging.Handler):
+ def emit(self, record):
+ pass
+
+logging.getLogger('oauthlib').addHandler(NullHandler())