Logger: Fix reformatting of message

Use the reformatted message when splitting lines instead of the
raw message to prevent exceptions.

Signed-off-by: kingbri <bdashore3@proton.me>
This commit is contained in:
kingbri 2024-03-09 15:40:37 -05:00
parent 4d09226364
commit c77259bfbb

View file

@ -51,10 +51,10 @@ def _log_formatter(record: dict) -> str:
separator = " " * (9 - len(level.name))
message = unwrap(record.get("message"), "")
lines = message.splitlines()
# Replace once loguru allows for turning off str.format
message = message.replace("{", "{{").replace("}", "}}")
lines = message.splitlines()
fmt = ""
if len(lines) > 1: