We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 103d28c commit 313fe40Copy full SHA for 313fe40
requests_oauthlib/log_filters.py
@@ -20,7 +20,10 @@ def __init__(self):
20
environment variable.
21
"""
22
super().__init__()
23
- self.mode = os.getenv('DEBUG_MODE_TOKEN_FILTER', 'DEFAULT').upper()
+ self.mode = os.getenv('DEBUG_MODE_TOKEN_FILTER', 'DEFAULT').upper()
24
+ if self.mode == 'DEFAULT':
25
+ msg = "Your logger, when in DEBUG mode, will log TOKENS"
26
+ raise Warning(msg)
27
28
def filter(self, record):
29
@@ -37,7 +40,4 @@ def filter(self, record):
37
40
record.msg = re.sub(r'Bearer (\w+)', '[MASKED]', record.getMessage())
38
41
elif self.mode == "SUPPRESS":
39
42
return False
- elif self.mode == "DEFAULT":
- msg = "Your logger, when in DEBUG mode, will log TOKENS"
- raise Warning(msg)
43
- return True
+ return True # if mode is not MASKED then DEFAULT is implied
0 commit comments