fix: TypeError in CustomFormatter.format

This commit is contained in:
airwave1981
2025-05-12 17:11:47 +02:00
committed by sebthom
parent f2e6f0b20b
commit 65738926ae

View File

@@ -65,7 +65,10 @@ def configure_console_logging() -> None:
} }
def format(self, record:logging.LogRecord) -> str: def format(self, record:logging.LogRecord) -> str:
record = copy.deepcopy(record) # Deep copy fails if record.args contains objects with
# __init__(...) parameters (e.g., CaptchaEncountered).
# A shallow copy is sufficient to preserve the original.
record = copy.copy(record)
level_color = self.LEVEL_COLORS.get(record.levelno, "") level_color = self.LEVEL_COLORS.get(record.levelno, "")
msg_color = self.MESSAGE_COLORS.get(record.levelno, "") msg_color = self.MESSAGE_COLORS.get(record.levelno, "")