Remove api key from logging
This commit is contained in:
@@ -37,4 +37,12 @@ class CPLog(object):
|
|||||||
for replace in self.replace_private:
|
for replace in self.replace_private:
|
||||||
msg = re.sub('(%s=)[^\&]+' % replace, '%s=xxx' % replace, msg)
|
msg = re.sub('(%s=)[^\&]+' % replace, '%s=xxx' % replace, msg)
|
||||||
|
|
||||||
|
# Replace api key
|
||||||
|
try:
|
||||||
|
from couchpotato.environment import Env
|
||||||
|
api_key = Env.setting('api_key')
|
||||||
|
msg = msg.replace(api_key, 'API_KEY')
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
|
||||||
return msg
|
return msg
|
||||||
|
|||||||
Reference in New Issue
Block a user