From edab385f951e38d65a25003f193793b63037bdec Mon Sep 17 00:00:00 2001 From: Ib Lundgren Date: Wed, 24 Sep 2014 14:52:53 +0100 Subject: 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. --- oauthlib/__init__.py | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'oauthlib/__init__.py') 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 ' __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()) -- cgit v1.2.1