Добавлено логирование ошибок

main
none 9 months ago
parent f061e67757
commit 6c611068d5

@ -11,6 +11,8 @@ from re import compile, sub
# Работа с БД и json # Работа с БД и json
from db import read from db import read
from json import loads from json import loads
# Логирование ошибок
import logging
from verify import * from verify import *
from domain_check import * from domain_check import *
@ -38,8 +40,9 @@ def server_http():
try: try:
os.chdir("cached") os.chdir("cached")
os.system("python -m http.server") os.system("python -m http.server")
except: except Exception as e:
print("SERVER_HTTP FALLED") print("SERVER_HTTP FALLED")
logging.critical(e, exc_info=True)
def server(http_port): def server(http_port):
while True: while True:
@ -85,8 +88,9 @@ def server(http_port):
conn.close() conn.close()
except: except Exception as e:
print("SERVER FALLED") print("SERVER_HTTP FALLED")
logging.critical(e, exc_info=True)
from time import time from time import time

Loading…
Cancel
Save