From bbcb9f3596c30eb66c5ac8c2f6a1c09aff45f065 Mon Sep 17 00:00:00 2001 From: trueold89 Date: Fri, 3 Nov 2023 17:43:50 +0300 Subject: [PATCH] Errors in the logs now have a separate label --- bot/log.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/bot/log.py b/bot/log.py index 912e795..e52f6ee 100644 --- a/bot/log.py +++ b/bot/log.py @@ -12,7 +12,7 @@ def dt(): str = f'{date} | {time.strftime("%H:%M:%S")}' return str -DEFAULT = f'{dt()} LOG: ' +DEFAULT = [f'{dt()} LOG: ',f'{dt()} ERROR: '] ID = str(uuid.uuid1())[0:7] FILE = f'{ID}.txt' @@ -24,42 +24,42 @@ def file(log): logfile.close() def start(): - log1 = DEFAULT + str(msg.get('l_create').format(FILE)) - log2 = DEFAULT + str(msg.get('l_start')) + log1 = DEFAULT[0] + str(msg.get('l_create').format(FILE)) + log2 = DEFAULT[0] + str(msg.get('l_start')) file(log2) print(f'{log1}\n{log2}') def auth(name,id): - log = DEFAULT + str(msg.get('l_auth').format(name,id)) + log = DEFAULT[0] + str(msg.get('l_auth').format(name,id)) file(log) print(log) def add(name,id,folder,path): - log = DEFAULT + str(msg.get('l_add').format(name,id,folder,path)) + log = DEFAULT[0] + str(msg.get('l_add').format(name,id,folder,path)) file(log) print(log) def rm(name,id,folder): - log = DEFAULT + str(msg.get('l_rm').format(name,id,folder)) + log = DEFAULT[0] + str(msg.get('l_rm').format(name,id,folder)) file(log) print(log) def addfile(name,id,filename): - log = DEFAULT + str(msg.get('l_file').format(name,id,filename[9:])) + log = DEFAULT[0] + str(msg.get('l_file').format(name,id,filename[9:])) file(log) print(log) def addmagnet(name,id,link): - log = DEFAULT + str(msg.get('l_magnet').format(name,id,link)) + log = DEFAULT[0] + str(msg.get('l_magnet').format(name,id,link)) file(log) print(log) def errqbt(): - log = DEFAULT + str(msg.get('l_errqbt')) + log = DEFAULT[1] + str(msg.get('l_errqbt')) file(log) print(log) def errtelebot(): - log = DEFAULT + str(msg.get('l_errtele')) + log = DEFAULT[1] + str(msg.get('l_errtele')) file(log) print(log)