Errors in the logs now have a separate label

This commit is contained in:
trueold89 2023-11-03 17:43:50 +03:00
parent ecff3ccf38
commit bbcb9f3596
Signed by: trueold89
GPG Key ID: C122E85DD49E6B30
1 changed files with 10 additions and 10 deletions

View File

@ -12,7 +12,7 @@ def dt():
str = f'{date} | {time.strftime("%H:%M:%S")}' str = f'{date} | {time.strftime("%H:%M:%S")}'
return str return str
DEFAULT = f'{dt()} LOG: ' DEFAULT = [f'{dt()} LOG: ',f'{dt()} ERROR: ']
ID = str(uuid.uuid1())[0:7] ID = str(uuid.uuid1())[0:7]
FILE = f'{ID}.txt' FILE = f'{ID}.txt'
@ -24,42 +24,42 @@ def file(log):
logfile.close() logfile.close()
def start(): def start():
log1 = DEFAULT + str(msg.get('l_create').format(FILE)) log1 = DEFAULT[0] + str(msg.get('l_create').format(FILE))
log2 = DEFAULT + str(msg.get('l_start')) log2 = DEFAULT[0] + str(msg.get('l_start'))
file(log2) file(log2)
print(f'{log1}\n{log2}') print(f'{log1}\n{log2}')
def auth(name,id): 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) file(log)
print(log) print(log)
def add(name,id,folder,path): 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) file(log)
print(log) print(log)
def rm(name,id,folder): 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) file(log)
print(log) print(log)
def addfile(name,id,filename): 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) file(log)
print(log) print(log)
def addmagnet(name,id,link): 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) file(log)
print(log) print(log)
def errqbt(): def errqbt():
log = DEFAULT + str(msg.get('l_errqbt')) log = DEFAULT[1] + str(msg.get('l_errqbt'))
file(log) file(log)
print(log) print(log)
def errtelebot(): def errtelebot():
log = DEFAULT + str(msg.get('l_errtele')) log = DEFAULT[1] + str(msg.get('l_errtele'))
file(log) file(log)
print(log) print(log)