From 15b2cf5601726616b38680e4991ee500db1668f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20S=C3=A1nchez?= Date: Fri, 17 Jan 2025 20:17:31 -0300 Subject: [PATCH] logging formatting --- libraries/earner.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libraries/earner.py b/libraries/earner.py index d7b8b96..1b90583 100644 --- a/libraries/earner.py +++ b/libraries/earner.py @@ -35,7 +35,7 @@ class earner: def write_to_log(self,message): with open("earn.log", "a") as f: - f.write(str(self.connector) + datetime.datetime.now().strftime(' [%Y/%m/%d %H:%M:%S] ') + message + "\n") + f.write(datetime.datetime.now().strftime(f"[%Y/%m/%d %H:%M:%S] {str(self.connector).upper()} | {message}\n")) def toggle_pause(self): self.is_paused = not self.is_paused @@ -121,7 +121,7 @@ class earner: def subscribe(self,amount,force_pause=False): - print(f"{datetime.datetime.now().strftime('[%Y/%m/%d %H:%M:%S]')} | {str(self.connector).upper()} | Subscribing {amount} {self.currency}") + print(f"{datetime.datetime.now().strftime('[%Y/%m/%d %H:%M:%S]')} | {str(self.connector).upper()} | {colors.green}Subscribing{colors.white} {amount} {self.currency}") self.write_to_log(f"{colors.green}Subscribing{colors.white} {amount} {self.currency}") if force_pause: @@ -157,7 +157,7 @@ class earner: return 1 def redeem(self,amount,force_pause=False): - print(f"{datetime.datetime.now().strftime('[%Y/%m/%d %H:%M:%S]')} | {str(self.connector).upper()} | Redeeming {amount} {self.currency}") + print(f"{datetime.datetime.now().strftime('[%Y/%m/%d %H:%M:%S]')} | {str(self.connector).upper()} | {colors.red}Redeeming{colors.white} {amount} {self.currency}") self.write_to_log(f"{colors.red}Redeeming{colors.white} {amount} {self.currency}") if force_pause: