logger: improve error handling
This commit is contained in:
parent
2793344684
commit
e25b8e5994
|
@ -33,5 +33,8 @@ class CustomFormatter(logging.Formatter):
|
||||||
return super().format(record)
|
return super().format(record)
|
||||||
|
|
||||||
def highlight_args(self, message, args, color):
|
def highlight_args(self, message, args, color):
|
||||||
highlighted_args = tuple(f"{color}{arg}{RESET}" for arg in args)
|
try:
|
||||||
return message % highlighted_args
|
highlighted_args = tuple(f"{color}{arg}{RESET}" for arg in args)
|
||||||
|
return message % highlighted_args
|
||||||
|
except (TypeError, ValueError):
|
||||||
|
return f"{color}{message}{RESET}"
|
||||||
|
|
Loading…
Reference in a new issue