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)
|
||||
|
||||
def highlight_args(self, message, args, color):
|
||||
try:
|
||||
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