1
0
mirror of https://github.com/moparisthebest/SickRage synced 2025-01-06 03:18:01 -05:00
This commit is contained in:
echel0n 2014-12-20 20:36:01 -08:00
parent 885ef128fc
commit d08d401769

View File

@ -51,8 +51,11 @@ class NullHandler(logging.Handler):
pass
class CensoredFormatter(logging.Formatter):
def __init__(self, *args, **kwargs):
super(CensoredFormatter, self).__init__(*args, **kwargs)
def format(self, record):
msg = record.getMessage()
msg = super(CensoredFormatter, self).format(record)
for k, v in censoredItems.items():
if v and len(v) > 0 and v in msg:
msg = msg.replace(v, len(v) * '*')