Add missing reset ANSI sequence

Do not forget to reset the red text once we print an error string to the
terminal
This commit is contained in:
Alex Pyrgiotis 2023-07-28 18:46:33 +03:00
parent 9768714b4a
commit 77f4b8115c
No known key found for this signature in database
GPG key ID: B6C15EBA0357C9AA

View file

@ -53,12 +53,12 @@ class IsolationProvider(ABC):
self, document: Document, error: bool, text: str, percentage: float
) -> None:
s = Style.BRIGHT + Fore.YELLOW + f"[doc {document.id}] "
s += Fore.CYAN + f"{percentage}% "
s += Fore.CYAN + f"{percentage}% " + Style.RESET_ALL
if error:
s += Style.RESET_ALL + Fore.RED + text
s += Fore.RED + text + Style.RESET_ALL
log.error(s)
else:
s += Style.RESET_ALL + text
s += text
log.info(s)
if self.progress_callback: