mirror of
https://github.com/Justuser3310/jetwork.git
synced 2025-02-08 01:37:38 +00:00
Добавлено логирование ошибок
This commit is contained in:
parent
f061e67757
commit
6c611068d5
10
network.py
10
network.py
@ -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…
Reference in New Issue
Block a user