mirror of
https://github.com/OMGeeky/gpt-pilot.git
synced 2026-02-23 15:49:50 +01:00
Fixed issue with logging from Peewee - provided tuple as record.msg
This commit is contained in:
@@ -47,7 +47,10 @@ def filter_sensitive_fields(record):
|
|||||||
record.args = tuple(args_list)
|
record.args = tuple(args_list)
|
||||||
|
|
||||||
# Remove ANSI escape sequences - colours & bold
|
# Remove ANSI escape sequences - colours & bold
|
||||||
record.msg = re.sub(r'\x1B(?:[@-Z\\-_]|\[[0-?]*[ -/]*[@-~])', '', record.msg)
|
# Peewee passes a tuple as record.msg
|
||||||
|
if isinstance(record.msg, str):
|
||||||
|
record.msg = re.sub(r'\x1B(?:[@-Z\\-_]|\[[0-?]*[ -/]*[@-~])', '', record.msg)
|
||||||
|
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user