From b4ff4ac715060ce313cdaee2345617b4b7a979ea Mon Sep 17 00:00:00 2001 From: admin <weikou2014> Date: 星期一, 08 一月 2024 16:19:58 +0800 Subject: [PATCH] bug修复/日志添加 --- middle_server.py | 8 +++++--- 1 files changed, 5 insertions(+), 3 deletions(-) diff --git a/middle_server.py b/middle_server.py index f757e7f..2553d77 100644 --- a/middle_server.py +++ b/middle_server.py @@ -9,6 +9,7 @@ import time import constant +import log import socket_manager from db import mysql_data from db.redis_manager import RedisUtils, RedisManager @@ -93,8 +94,8 @@ {"code": 100, "msg": f"JSON瑙f瀽澶辫触"}).encode( encoding='utf-8'))) continue - thread_id = random.randint(0, 1000000) - logger_request_debug.info(f"middle_server 璇锋眰寮�濮�({thread_id})锛歿data_json.get('type')}") + type_= data_json["type"] + log.request_info("middle_server", f"璇锋眰寮�濮嬶細{type_}") try: if data_json["type"] == 'register': client_type = data_json["data"]["client_type"] @@ -261,7 +262,8 @@ sk.sendall(socket_util.load_header(result_str.encode(encoding='utf-8'))) pass finally: - logger_request_debug.info(f"middle_server 璇锋眰缁撴潫({thread_id})锛歿data_json.get('type')}") + log.request_info("middle_server", f"璇锋眰缁撴潫") + else: # 鏂紑杩炴帴 break -- Gitblit v1.8.0