From 5ae97b984f9fe29717c125c205f79c87c6370613 Mon Sep 17 00:00:00 2001 From: Abhishek Patel Date: Sun, 21 Apr 2019 12:09:00 -0700 Subject: Add method to get/set debug flag - By default debug mode is always off - Debug mode turned on automatically for tests - Complete requests sanitized in non debug mode --- oauthlib/__init__.py | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'oauthlib/__init__.py') diff --git a/oauthlib/__init__.py b/oauthlib/__init__.py index 8eb82a6..8639e88 100644 --- a/oauthlib/__init__.py +++ b/oauthlib/__init__.py @@ -15,3 +15,12 @@ __author__ = 'The OAuthlib Community' __version__ = '3.0.2-dev' logging.getLogger('oauthlib').addHandler(NullHandler()) + +_DEBUG = False + +def set_debug(debug_val): + global _DEBUG + _DEBUG = debug_val + +def get_debug_flag(): + return _DEBUG -- cgit v1.2.1