使用中文日志 调整一些业务逻辑
This commit is contained in:
@@ -7,6 +7,8 @@ import socket
|
||||
|
||||
|
||||
import prot_codec as pc
|
||||
from log import myprint
|
||||
from log import log_init
|
||||
|
||||
|
||||
|
||||
@@ -40,7 +42,7 @@ class tcp_target(object):
|
||||
global _tcp_server
|
||||
# 解包查看数据类型
|
||||
cmd,data=pc.decode(recv_data)
|
||||
print(cmd.decode('utf-8'))
|
||||
myprint(cmd.decode('utf-8'))
|
||||
j=json.loads(cmd)
|
||||
if(j["device"]=="client"):
|
||||
if(j["option"]=="login"):
|
||||
@@ -72,12 +74,12 @@ class tcp_target(object):
|
||||
try:
|
||||
_tcp_client.send(data)
|
||||
except Exception as e:
|
||||
print("target_close:",str(e))
|
||||
myprint("target_close:",str(e))
|
||||
if(_tcp_server is not None):
|
||||
try:
|
||||
_tcp_server.send(data)
|
||||
except Exception as e:
|
||||
print("target_close:",str(e))
|
||||
myprint("target_close:",str(e))
|
||||
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user