mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-08-21 05:43:22 -07:00
More logger blacklist improvements
This commit is contained in:
parent
b3b2752554
commit
33fc079318
1 changed files with 13 additions and 3 deletions
|
@ -103,11 +103,21 @@ class BlacklistFilter(logging.Filter):
|
||||||
try:
|
try:
|
||||||
if item in record.msg:
|
if item in record.msg:
|
||||||
record.msg = record.msg.replace(item, 16 * '*')
|
record.msg = record.msg.replace(item, 16 * '*')
|
||||||
if any(item in str(arg) for arg in record.args):
|
|
||||||
record.args = tuple(arg.replace(item, 16 * '*') if isinstance(arg, str) else arg
|
args = []
|
||||||
for arg in record.args)
|
for arg in record.args:
|
||||||
|
try:
|
||||||
|
arg_str = str(arg)
|
||||||
|
if item in arg_str:
|
||||||
|
arg_str = arg_str.replace(item, 16 * '*')
|
||||||
|
arg = arg_str
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
args.append(arg)
|
||||||
|
record.args = tuple(args)
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue