From 6c611068d53fcae59f44b9b64602a05c098481ac Mon Sep 17 00:00:00 2001 From: none Date: Sun, 25 Feb 2024 22:07:32 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D0=BE=20=D0=BB=D0=BE=D0=B3=D0=B8=D1=80=D0=BE=D0=B2=D0=B0?= =?UTF-8?q?=D0=BD=D0=B8=D0=B5=20=D0=BE=D1=88=D0=B8=D0=B1=D0=BE=D0=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- network.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/network.py b/network.py index 583a1e7..14dc597 100644 --- a/network.py +++ b/network.py @@ -11,6 +11,8 @@ from re import compile, sub # Работа с БД и json from db import read from json import loads +# Логирование ошибок +import logging from verify import * from domain_check import * @@ -38,8 +40,9 @@ def server_http(): try: os.chdir("cached") os.system("python -m http.server") - except: + except Exception as e: print("SERVER_HTTP FALLED") + logging.critical(e, exc_info=True) def server(http_port): while True: @@ -85,8 +88,9 @@ def server(http_port): conn.close() - except: - print("SERVER FALLED") + except Exception as e: + print("SERVER_HTTP FALLED") + logging.critical(e, exc_info=True) from time import time