mirror of
https://github.com/OMGeeky/gpt-pilot.git
synced 2025-12-29 07:35:44 +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)
|
||||
|
||||
# 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
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user