logging formatting
This commit is contained in:
parent
4ed36e1482
commit
15b2cf5601
|
|
@ -35,7 +35,7 @@ class earner:
|
||||||
|
|
||||||
def write_to_log(self,message):
|
def write_to_log(self,message):
|
||||||
with open("earn.log", "a") as f:
|
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):
|
def toggle_pause(self):
|
||||||
self.is_paused = not self.is_paused
|
self.is_paused = not self.is_paused
|
||||||
|
|
@ -121,7 +121,7 @@ class earner:
|
||||||
|
|
||||||
|
|
||||||
def subscribe(self,amount,force_pause=False):
|
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}")
|
self.write_to_log(f"{colors.green}Subscribing{colors.white} {amount} {self.currency}")
|
||||||
|
|
||||||
if force_pause:
|
if force_pause:
|
||||||
|
|
@ -157,7 +157,7 @@ class earner:
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
def redeem(self,amount,force_pause=False):
|
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}")
|
self.write_to_log(f"{colors.red}Redeeming{colors.white} {amount} {self.currency}")
|
||||||
|
|
||||||
if force_pause:
|
if force_pause:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue