Update logger.py

This commit is contained in:
Ayush Saini 2022-12-14 21:58:44 +05:30
parent eb94b72bcf
commit 1887f8e3aa

View file

@ -93,7 +93,7 @@ class dumplogs(threading.Thread):
else: else:
log_path = SERVER_DATA_PATH + "logs.log" log_path = SERVER_DATA_PATH + "logs.log"
if os.path.exists(log_path): if os.path.exists(log_path):
if os.stat(log_path).st_size > 1000: if os.stat(log_path).st_size > 1000000:
shutil.copy(log_path, log_path+str(datetime.datetime.now())) shutil.copy(log_path, log_path+str(datetime.datetime.now()))
os.remove(log_path) os.remove(log_path)
with open(log_path, mode="a+", encoding="utf-8") as file: with open(log_path, mode="a+", encoding="utf-8") as file: