File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,10 @@ def __init__(self):
2020 environment variable.
2121 """
2222 super ().__init__ ()
23- self .mode = os .getenv ('DEBUG_MODE_TOKEN_FILTER' , 'DEFAULT' ).upper ()
23+ 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 )
2427
2528 def filter (self , record ):
2629 """
@@ -37,7 +40,4 @@ def filter(self, record):
3740 record .msg = re .sub (r'Bearer (\w+)' , '[MASKED]' , record .getMessage ())
3841 elif self .mode == "SUPPRESS" :
3942 return False
40- elif self .mode == "DEFAULT" :
41- msg = "Your logger, when in DEBUG mode, will log TOKENS"
42- raise Warning (msg )
43- return True
43+ return True # if mode is not MASKED then DEFAULT is implied
You can’t perform that action at this time.
0 commit comments