diff options
author | Ib Lundgren <ib.lundgren@gmail.com> | 2014-09-24 14:52:53 +0100 |
---|---|---|
committer | Ib Lundgren <ib.lundgren@gmail.com> | 2014-09-24 14:52:53 +0100 |
commit | edab385f951e38d65a25003f193793b63037bdec (patch) | |
tree | 0c5658eacb8aeca13556314cd0cffdf1db88f5c9 /oauthlib/__init__.py | |
parent | 3bb2bfbb593386169e997e3332b236c077a546db (diff) | |
download | oauthlib-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__.py | 11 |
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()) |