当前位置:   article > 正文

tornado、flask、c++zmq-req-rep记录_bhkan.info

bhkan.info

python使用的docker

  1. 准备如下文件,并加上可执行权限。
  2. ./build.sh 创建镜像
  3. ./run.sh 运行容器
  4. docker exec -it py3.7 bash 进入容器
  5. 将下述文件放在同一个目录
  6. Dockerfile code pip.conf run.sh sources.list build.sh
  7. build.sh如下
  8. docker build -t test_python:3.7 .
  9. Dockerfile如下
  10. FROM python:3.7
  11. #定义构建的名称
  12. #ARG buildversion
  13. COPY ./sources.list /etc/apt/sources.list
  14. COPY ./pip.conf /etc/
  15. RUN echo 'Asia/Shanghai' >/etc/timezone \
  16. && apt-get update -y \
  17. && apt-get install vim -y \
  18. && apt-get install tree -y \
  19. && apt-get install zip -y \
  20. && apt-get install unzip -y \
  21. && apt-get install net-tools -y \
  22. && pip install xlsxwriter \
  23. && pip install openpyxl \
  24. && pip install xlrd \
  25. && pip install numpy scipy matplotlib \
  26. && pip install pytest \
  27. && pip install pytest-html \
  28. && pip install pandas \
  29. && pip install robotframework \
  30. && pip install requests \
  31. && pip install collection \
  32. && pip install robotframework-httplibrary \
  33. && pip install RESTinstance \
  34. && pip install docker \
  35. && pip install pyyaml \
  36. && pip install tornado \
  37. && pip install flask \
  38. && pip install gevent \
  39. && pip --default-timeout=100 install pyyaml -i https://pypi.tuna.tsinghua.edu.cn/simple
  40. pip.conf 如下
  41. [global]
  42. index-url = https://pypi.tuna.tsinghua.edu.cn/simple
  43. run.sh 如下
  44. docker run -dit --privileged=true --network host --restart=on-failure --name=py3.7 -v $PWD:/test test_python:3.7 sh -c 'sleep 36000000000'
  45. sources.list 如下
  46. deb http://mirrors.ustc.edu.cn/debian buster main contrib non-free
  47. deb http://mirrors.ustc.edu.cn/debian buster-backports main contrib non-free
  48. deb http://mirrors.ustc.edu.cn/debian buster-proposed-updates main contrib non-free
  49. deb http://mirrors.ustc.edu.cn/debian-security buster/updates main contrib non-free

将下属文件放在一个目录下,如code目录

tornado web服务

  1. # -*- coding: UTF-8 -*-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ma5J5DjJYH19atxSGGYupJB4YE9QexrP1QCOTYjEhh8p9R613wSirI8mpNzd2Umk3uT+ApNp6+9NUH0p+T6DHrVRMRT04NNALZzSnIAzikGBVCAk56/Wm9/egk5/rS+3ehgHTOf0pV6c9aB0zikByMUr6ASZweKT8SaQFgMgA0wSY68/0qLlIlPHAxQo3Y9e1NY5HX6U+M/MKGwtqegeGF/cjjnFdjbnaMmuW8LJutlIJOBXTZ8tM1izrjsSyOu7k0+OUbW57VlyTHecUecyjrQXcttIFn684qWeUNCCT2rM3szbs5pZJWyoBoFcbKwAYg1t6K/7hfesGfmI5GDW3oufIWm0JPU03JL1Qll/fjBq3M+CT6VkSS5uCAaRd7GvvwnXpTUcE1U85jGM96dE3ylvSpsMdeSKE5NVYZOT3rN1a/Mbbc1n22qgEE9Ce1HKw5kdOZsUVjrqKMM4/M0UcrDnR5Ae9NoorsPNCl70UUAL/CfpSD7lFFACJ1apF+6PrRRQVEVe9ObqtFFA1uQt96nHov0NFFZjIv8AGk/hFFFNE9RE6mlH3qKKJbi6kw6r9aWX7y/SiikWaHh7/j7m/wB2u0tv+PCL/gP/AKLNFFJmsdjl3+4Pq/8A6EabD/rl/wCugoopgXNI/wCQjH/19j+tTat/x+N/vf8AstFFJ7jN74bf8hDUf91f5mvSD/q6KK5KnxM76PwI8p+IH/H2v/XJP/QzWPofWP8A6/jRRSf8NhH+Keha1/yCLz/rg38q8vf7kf8AuiiitMPsY4v4hj/cm/3zWff/APLL/rmKKK6lsee9iun3TQPun60UVSIBv4aQ9vrRRTAVulM7tRRQAqfc/CkHaiipkARdPzqPtRRUlLcm/gp8X3hRRQPqeneFf+PUfSt+f/VmiisXudS2M8/fP0pG6UUUDHR9TUc3UUUUAJJ9yug0f/j2WiimxFif77fSsVv+PoUUUimXG/1IqaH/AFRoooK6HK6//r/wrJtvur9aKKpGT3LJ6n60UUUCP//Z"
  3. imgBaseNoNMd5="c49d86602e9c73032d9afe011dd13209"
  4. from log import _clog
  5. import subprocess
  6. import os
  7. import time
  8. import shutil
  9. from tornado.web import Application, RequestHandler
  10. from tornado.ioloop import IOLoop
  11. from tornado.options import define, options, parse_command_line
  12. from tornado.httpserver import HTTPServer
  13. import os.path
  14. import urllib
  15. import json
  16. import datetime
  17. import hashlib
  18. import random
  19. import ctypes
  20. import base64
  21. import subprocess
  22. import requests
  23. import threading
  24. import time
  25. #import demjson
  26. g_rysjsc_call_back = None
  27. g_face_call_back = None
  28. from tornado.options import define, options
  29. os.environ['LD_LIBRARY_PATH']="/auth_server/bin/lvmi/"
  30. define("port", default=9999, help="run on the given port")
  31. define("rysjsc_url", default=r"/jczpt/v3/rysjsc", help="run on the given port")
  32. define("face_url", default=r"/jczpt/v3/face", help="run on the given port")
  33. define("sbzt_url", default=r"/jczpt/v3/sbzt", help="run on the given port")
  34. define("my_test_url", default=r"/test", help="test postqueset")
  35. print ("Hello dilusense!!!")
  36. #is_error == 0
  37. g_err_code={0:"ok",
  38. 1:"user is error"
  39. }
  40. class test(RequestHandler):
  41. def post(self):
  42. is_error = 0
  43. body_dic = None
  44. default_v = 'null'
  45. try:
  46. body_dic = json.loads(self.request.body)
  47. _clog.info("1-----------------------------------------------------------------------test")
  48. _clog.info(body_dic)
  49. _clog.info("2-----------------------------------------------------------------------test")
  50. #_clog.info(body_dic)
  51. except Exception as e:
  52. _clog.error(e)
  53. #身份证回调函数
  54. def rysjsc_hdl_callbak():
  55. try:
  56. ret_list = {}
  57. ret_list2 = {}
  58. ret_list["ver"] = "3.0"
  59. ret_list["tranType"] = "10101"
  60. ret_list["tranNO"] = "000192ff-bcb7-4b1d-aa5e-f4b37feafda8"
  61. ret_list["sendTime"] = "2020-10-15 10:49:44"
  62. ret_list2["equipmentId"] = "653101010222200001"
  63. ret_list2["message"] = "0|请开闸放行"
  64. ret_list["data"] = ret_list2
  65. ret = json.dumps(ret_list)
  66. _clog.info("idcard ret is %s" % (ret))
  67. _clog.info("idcard g_rysjsc_call_back is %s" % (g_rysjsc_call_back))
  68. headers = {
  69. 'Connection': 'close'
  70. }
  71. r = requests.post(g_rysjsc_call_back, json=ret, headers=headers)
  72. #s = requests.session()
  73. #s.keep_alive = False
  74. #r = s.post(g_rysjsc_call_back, json=ret)
  75. _clog.info("idcar r.text is %s" % (r.text))
  76. except Exception as e:
  77. _clog.error(e)
  78. #身份证处理函数
  79. class rysjsc_hdl(RequestHandler):
  80. def post(self):
  81. is_error = 0
  82. body_dic = None
  83. default_v = 'null'
  84. try:
  85. body_dic = json.loads(self.request.body)
  86. global g_rysjsc_call_back
  87. g_rysjsc_call_back = body_dic["backUrl"]
  88. #_clog.info(body_dic)
  89. except Exception as e:
  90. _clog.error(e)
  91. ret_list = {}
  92. ret_list["ver"] = "3.0"
  93. ret_list["tranType"] = "10092"
  94. ret_list["tranNO"] = "000192ff-bcb7-4b1d-aa5e-f4b37feafda8"
  95. ret_list["sendTime"] = "2020-10-15 10:49:42"
  96. ret_list["tranResult"] = "200"
  97. ret_list["tranMsg"] = "tranMsg"
  98. ret = json.dumps(ret_list)
  99. #ret = demjson.decode(ret)
  100. self.write(ret)
  101. #rysjsc_hdl_callbak()
  102. t = threading.Thread(target=rysjsc_hdl_callbak)
  103. t.start()
  104. #人脸回调函数
  105. def face_hdl_callbak():
  106. try:
  107. ret_list = {}
  108. ret_list["ver"] = "3.0"
  109. ret_list["tranType"] = "10191"
  110. ret_list["tranNO"] = "000192ff-bcb7-4b1d-aa5e-f4b37feafda8"
  111. ret_list["sendTime"] = "2020-10-15 10:49:44"
  112. ret_list2 = {}
  113. ret_list2["equipmentId"] = "653101010222200001"
  114. ret_list2["message"] = "0|请开闸放行"
  115. ret_list3 = {}
  116. ret_list3["cardType"] = "653101010222200001"
  117. ret_list3["name"] = "张三"
  118. ret_list3["sex"] = "1"
  119. ret_list3["idcardImg"] = imgBaseNoN
  120. ret_list3["hash"] = imgBaseNoNMd5
  121. ret_list2["person"] = ret_list3
  122. ret_list["data"] = ret_list2
  123. ret = json.dumps(ret_list)
  124. _clog.info("face ret is %s" % (ret))
  125. _clog.info("g_face_call_back is %s" % (g_face_call_back))
  126. headers = {
  127. 'Connection': 'close'
  128. }
  129. r = requests.post(g_face_call_back, json=ret, headers=headers)
  130. #s = requests.session()
  131. #s.keep_alive = False
  132. #r = s.post(g_face_call_back, json=ret)
  133. _clog.info("face r.text is %s" % (r.text))
  134. except Exception as e:
  135. _clog.error(e)
  136. #人脸处理函数
  137. class face_hdl(RequestHandler):
  138. def post(self):
  139. is_error = 0
  140. body_dic = None
  141. default_v = 'null'
  142. try:
  143. body_dic = json.loads(self.request.body)
  144. global g_face_call_back
  145. g_face_call_back = body_dic["backUrl"]
  146. print ("backUrl %s " % (body_dic["backUrl"]))
  147. _clog.info("-----------------------------------------------------------------------")
  148. _clog.info(body_dic)
  149. except Exception as e:
  150. _clog.error(e)
  151. ret_list = {}
  152. ret_list["ver"] = "3.0"
  153. ret_list["tranType"] = "10092"
  154. ret_list["tranNO"] = "000192ff-bcb7-4b1d-aa5e-f4b37feafda8"
  155. ret_list["sendTime"] = "2020-10-15 10:49:42"
  156. ret_list["tranResult"] = "200"
  157. ret_list["tranMsg"] = "tranMsg"
  158. ret = json.dumps(ret_list)
  159. self.write(ret)
  160. #ret = demjson.decode(ret)
  161. t = threading.Thread(target=face_hdl_callbak)
  162. t.start()
  163. #设备状态
  164. class sbzt_hdl(RequestHandler):
  165. def post(self):
  166. is_error = 0
  167. body_dic = None
  168. default_v = 'null'
  169. try:
  170. body_dic = json.loads(self.request.body)
  171. _clog.info("-----------------------------------------------------------------------++++++++++++++++")
  172. _clog.info(body_dic)
  173. except Exception as e:
  174. _clog.error(e)
  175. ret_list = {}
  176. ret_list["ver"] = "3.0"
  177. ret_list["tranType"] = "10092"
  178. ret_list["tranNO"] = "000192ff-bcb7-4b1d-aa5e-f4b37feafda8"
  179. ret_list["sendTime"] = "2020-10-15 10:49:42"
  180. ret_list["tranResult"] = "200"
  181. ret_list["tranMsg"] = "tranMsg"
  182. ret = json.dumps(ret_list)
  183. #ret = demjson.decode(ret)
  184. self.write(ret)
  185. class web_svr:
  186. def __init__(self):
  187. pass
  188. def start_auth_server(self):
  189. try:
  190. options.parse_command_line()
  191. #app = Application(handlers=[(options.auth_url, web_hdl), (options.auth_soft_url, web_soft_hdl)])
  192. app = Application(handlers=[(options.rysjsc_url, rysjsc_hdl), (options.face_url, face_hdl), (options.sbzt_url, sbzt_hdl), (options.my_test_url, test)])
  193. http_server = HTTPServer(app)
  194. http_server.listen(options.port)
  195. #http_server.bind(options.port)
  196. #http_server.start(2)
  197. IOLoop.instance().start()
  198. except Exception as e:
  199. _clog.error(e)
  200. def t_q():
  201. url = "http://10.0.1.192:8383/callback"
  202. r = requests.post(url, json="{'a':'1'}")
  203. print (r.text)
  204. if __name__ == "__main__":
  205. svr = web_svr()
  206. svr.start_auth_server()

flask服务

  1. #!/user/bin/env python
  2. # coding=utf-8
  3. """
  4. @project : TestDemo
  5. @author : huyi
  6. @file : app.py
  7. @ide : PyCharm
  8. @time : 2021-10-15 11:58:44
  9. """
  10. from flask import Flask, request
  11. from gevent.pywsgi import WSGIServer
  12. from gevent import monkey
  13. import json
  14. import zmq, sys
  15. g_2_or_3 = 3
  16. # 将python标准的io方法,都替换成gevent中的同名方法,遇到io阻塞gevent自动进行协程切换
  17. monkey.patch_all()
  18. app = Flask(__name__)
  19. # face
  20. @app.route('/callback', methods=['POST'])
  21. def progress():
  22. try:
  23. request_data = json.loads(request.data)
  24. print("结果回调:{}".format(request_data))
  25. context = zmq.Context()
  26. socket = context.socket(zmq.REQ) # 设置socket类型,请求端
  27. socket.connect("tcp://10.0.1.192:6003") # 连接服务端的IP和端口
  28. socket.send_string(request_data) # 向服务端发送消息
  29. message = socket.recv() # 接收服务端返回的消息,注:是byte类型
  30. print("face recv info: " )
  31. zmqrecv_data = json.loads(message)
  32. print( zmqrecv_data)
  33. socket.close()
  34. return zmqrecv_data
  35. except Exception as e:
  36. print("face is error: " + e)
  37. # idcard
  38. @app.route('/callback/person', methods=['POST'])
  39. def result():
  40. try:
  41. request_data = json.loads(request.data)
  42. print("结果回调:{}".format(request_data))
  43. context = zmq.Context()
  44. socket = context.socket(zmq.REQ) # 设置socket类型,请求端
  45. socket.connect("tcp://10.0.1.192:6002") # 连接服务端的IP和端口
  46. socket.send_string(request_data) # 向服务端发送消息
  47. message = socket.recv() # 接收服务端返回的消息,注:是byte类型
  48. print("idcar recv info: " )
  49. zmqrecv_data = json.loads(message)
  50. print( zmqrecv_data)
  51. socket.close()
  52. return zmqrecv_data
  53. except Exception as e:
  54. print("idcard is error: " + e)
  55. if __name__ == '__main__':
  56. print("start.")
  57. WSGIServer(('0.0.0.0', 9001), app).serve_forever()

flask内zmq改进超时版本

  1. #!/user/bin/env python
  2. # coding=utf-8
  3. """
  4. @project :
  5. @author :
  6. @file :
  7. @ide :
  8. @time :
  9. """
  10. from flask import Flask, request
  11. from gevent.pywsgi import WSGIServer
  12. from gevent import monkey
  13. import json
  14. import zmq, sys
  15. from log import _clog
  16. g_2_or_3 = 3
  17. # 将python标准的io方法,都替换成gevent中的同名方法,遇到io阻塞gevent自动进行协程切换
  18. monkey.patch_all()
  19. app = Flask(__name__)
  20. # face
  21. @app.route('/callback', methods=['POST'])
  22. def progress():
  23. try:
  24. request_data = json.loads(request.data)
  25. _clog.info("face 结果回调:{}".format(request_data))
  26. _clog.info("face zmq.Context ...")
  27. context = zmq.Context()
  28. _clog.info("face context.socket ...")
  29. socket = context.socket(zmq.REQ) # 设置socket类型,请求端
  30. _clog.info("face socket.connect ...")
  31. socket.connect("tcp://127.0.0.1:6003") # 连接服务端的IP和端口
  32. _clog.info("face socket.setsockopt ...")
  33. socket.setsockopt(zmq.LINGER, 0)
  34. _clog.info("face zmq.Poller ...")
  35. poll = zmq.Poller()
  36. _clog.info("face poll.register ...")
  37. poll.register(socket, zmq.POLLIN)
  38. _clog.info("face socket.send_string ...")
  39. socket.send_string(request_data) # 向服务端发送消息
  40. socks = dict(poll.poll(3000))
  41. if socks.get(socket) == zmq.POLLIN:
  42. message = socket.recv() # 接收服务端返回的消息,注:是byte类型
  43. zmqrecv_data = json.loads(message)
  44. _clog.info("face recv info: ")
  45. _clog.info(zmqrecv_data)
  46. ret_info = json.dumps(zmqrecv_data)
  47. return ret_info
  48. poll.unregister(socket)
  49. socket.close()
  50. context.destroy()
  51. except Exception as e:
  52. _clog.error("face is error: ")
  53. _clog.error(e)
  54. # idcard
  55. @app.route('/callback/person', methods=['POST'])
  56. def result():
  57. try:
  58. request_data = json.loads(request.data)
  59. _clog.info("idcard 结果回调:{}".format(request_data))
  60. _clog.info("idcard zmq.Context ...")
  61. context = zmq.Context()
  62. _clog.info("idcard context.socket ...")
  63. socket = context.socket(zmq.REQ) # 设置socket类型,请求端
  64. _clog.info("idcard socket.connect ...")
  65. socket.connect("tcp://127.0.0.1:6002") # 连接服务端的IP和端口
  66. _clog.info("idcard socket.setsockopt ...")
  67. socket.setsockopt(zmq.LINGER, 0)
  68. _clog.info("idcard zmq.Poller ...")
  69. poll = zmq.Poller()
  70. _clog.info("idcard poll.register ...")
  71. poll.register(socket, zmq.POLLIN)
  72. _clog.info("idcard socket.send_string ...")
  73. socket.send_string(request_data) # 向服务端发送消息
  74. socks = dict(poll.poll(3000))
  75. if socks.get(socket) == zmq.POLLIN:
  76. message = socket.recv() # 接收服务端返回的消息,注:是byte类型
  77. zmqrecv_data = json.loads(message)
  78. _clog.info("idcard recv info: ")
  79. _clog.info(zmqrecv_data)
  80. ret_info = json.dumps(zmqrecv_data)
  81. return ret_info
  82. poll.unregister(socket)
  83. socket.close()
  84. context.destroy()
  85. except Exception as e:
  86. _clog.error("idcard is error: ")
  87. _clog.error(e)
  88. if __name__ == '__main__':
  89. print("start.")
  90. WSGIServer(('0.0.0.0', 9001), app).serve_forever()

c++ zmq req/rep模式

  1. void *ctx = NULL;
  2. void *s = NULL;
  3. bool
  4. CWorkThread::WaitCallbakForFace()
  5. {
  6. LOG(INFO) << " >>---->>> " << __FUNCTION__ << " begin. ";
  7. static bool init_net = false;
  8. if (!init_net) {
  9. zmq_close(s);
  10. zmq_term(ctx);
  11. ctx = zmq_init(1); // 创建上下文, 初始化一个io_thread
  12. if (!ctx) {
  13. LOG(INFO) << ">>---->>>" << "error in zmq_init:" << zmq_strerror (errno);
  14. return false;
  15. }
  16. s = zmq_socket(ctx, ZMQ_REP); // 创建REP类型的socket
  17. if (!s) {
  18. LOG(INFO) << ">>---->>>" << "error in zmq_socket:" << zmq_strerror (errno);
  19. zmq_term(ctx);
  20. return false;
  21. }
  22. LOG(INFO) << " >>---->>> ";
  23. int rc =zmq_bind(s, "tcp://*:6003"); // 绑定到端口并且在io_thread中accept连接
  24. if (rc != 0) {
  25. LOG(INFO) << ">>---->>>" << "error in zmq_socket:" << zmq_strerror (errno);
  26. zmq_close(s);
  27. zmq_term(ctx);
  28. return false;
  29. }
  30. const int nRequestTime = m_iRequestTimeout * 1000; //1s
  31. int zmqRes = zmq_setsockopt(s, ZMQ_SNDTIMEO, &nRequestTime, sizeof(nRequestTime));
  32. zmqRes = zmq_setsockopt(s, ZMQ_RCVTIMEO, &nRequestTime, sizeof(nRequestTime));
  33. LOG(INFO) << " >>---->>> " << __FUNCTION__ << ", m_iRequestTimeout is " << m_iRequestTimeout<< ", nRequestTime is " << nRequestTime;
  34. init_net = false;
  35. }
  36. #if 0 //demo
  37. LOG(INFO) << " >>---->>> " << __FUNCTION__ ;
  38. CThreadPool* p = CThreadPool::GetInstance();
  39. p->AddTaskToPool(boost::bind(&CWorkThread::ZmqReq, this));
  40. #endif
  41. if(m_currentWorkModel == WORK_MODEL_RECGNITOIN_AND_COLLECT_3D2D) {
  42. if(HAVE_ABORT == GetFaceAndIDCardState(FACE_CODE, false) || 1 == m_iIDCardExitFlag){
  43. LOG(INFO) << ">>---->>>" << "I(face) will exist:";
  44. return true; //整个流程视为成功
  45. }
  46. }
  47. // Wait for next request from client
  48. const int len = 1024000;
  49. char* recvContent = new char[len]; // 创建消息结构
  50. memset(recvContent, 0, len);
  51. int r = zmq_recv(s, (void*)recvContent, len, 0); // 从管道中接收消息
  52. if (r <= 0) {
  53. LOG(INFO) << " >>---->>> " << __FUNCTION__ << " zmq_recv error, failed. " << zmq_strerror(errno) << ",errno is " << errno
  54. << ",EAGAIN is " << EAGAIN << ",ENOTSUP is " << ENOTSUP<< ",EINTR is " << EINTR<< ",ENOTSOCK is " << ENOTSOCK
  55. << ",ETERM is " << ETERM<< ",EFSM is " << EFSM<< ",ENOTSUP is " << ENOTSUP;
  56. delete []recvContent;
  57. init_net = false;
  58. return false;
  59. }
  60. NotifyIDCardThreadToExit();
  61. LOG(INFO) << " >>---->>> " << __FUNCTION__ << ", recvCt: " << recvContent;
  62. Json::Value Jret;
  63. Json::Reader reader(Json::Features::strictMode());
  64. if(!reader.parse(recvContent, Jret)) {
  65. LOG(ERROR) << " >>---->>> " << "Initialize Json::Reader from WaitCallbakForIdcard error, failed";
  66. delete []recvContent;
  67. return false;
  68. }
  69. Json::Value v = Jret["data"];
  70. LOG(ERROR) << " >>---->>> " << "v[message]: " << v["message"].asString().c_str();
  71. char isPass[2] = {0,0};
  72. memcpy(isPass, v["message"].asString().c_str(), 1);
  73. if(atoi(isPass) != 0) {
  74. LOG(ERROR) << " >>---->>> "<< "Getting CODE info from 3DFace 1vN search return value, failed";
  75. m_iWarningType |= BLACKLISTPERSON_REQ;
  76. //return false;
  77. }
  78. LOG(ERROR) << " >>---->>> " << "isPass: " << isPass;
  79. m_isGetSearchResult = ParseLhcz2D1vNSearchResult(Jret);
  80. Json::Value rootJson;
  81. rootJson["ver"] = "3.0";
  82. rootJson["tranType"] = "10101";
  83. rootJson["tranNO"] = getRandomNum(36);
  84. rootJson["sendTime"] = QDateTime::currentDateTime().toString("yyyy-MM-dd hh:mm:ss").toStdString();
  85. rootJson["tranResult"] = "200";
  86. rootJson["tranMsg"] = "";
  87. string repContent = rootJson.toStyledString().c_str();
  88. LOG(INFO) << " >>---->>> " << "repContent is " << repContent;;
  89. int sc = zmq_send(s, (void*)repContent.c_str(), repContent.length(), 0); // 发送消息到管道,等待io_thread从管道中读取后发送
  90. if (sc <= 0) {
  91. LOG(WARNING) << " >>---->>> " << __FUNCTION__ << " zmq_send error, failed. " << zmq_strerror(errno);
  92. delete []recvContent;
  93. init_net = true;
  94. return true;
  95. }
  96. LOG(INFO) << " >>---->>> ";;
  97. // We never get here but if we did, this would be how we end
  98. delete []recvContent;
  99. LOG(INFO) << " >>---->>> " << __FUNCTION__ << " end. ";
  100. return true;
  101. }

log.py

  1. # -*- coding: UTF-8 -*-
  2. import logging
  3. from logging.handlers import TimedRotatingFileHandler
  4. from logging.handlers import RotatingFileHandler
  5. import re
  6. import time
  7. import os
  8. from tornado.options import define, options, parse_command_line
  9. define("log_path", default="./log/", help="./")
  10. def log_init():
  11. try:
  12. log_path = options.log_path
  13. try:
  14. if not os.path.exists(log_path):
  15. os.makedirs(log_path)
  16. except Exception as e:
  17. logging.error(e)
  18. logging.basicConfig(level=logging.DEBUG, format="%(asctime)s|%(levelname)s|%(filename)s:%(lineno)d|%(message)s", datefmt='%Y-%m-%d %H:%M:%S')
  19. log_fmt = '%(asctime)s\t %(filename)s:%(lineno)s %(levelname)s> %(message)s'
  20. formatter = logging.Formatter(log_fmt)
  21. log_file_handler = TimedRotatingFileHandler(filename=log_path +"trace.log", when="D", interval=1, backupCount=2)
  22. log_file_handler.suffix = "%Y-%m-%d_%H-%M"
  23. log_file_handler.extMatch = re.compile(r"^\d{4}-\d{2}-\d{2}_\d{2}-\d{2}$")
  24. log_file_handler.setFormatter(formatter)
  25. log = logging.getLogger()
  26. log.addHandler(log_file_handler)
  27. return log;
  28. #removeHandler 要放在程序运用打印日志的后面
  29. #log.removeHandler(log_file_handler)()
  30. except Exception as e:
  31. logging.error(e)
  32. _clog = log_init()
  33. if __name__ == '__main__':
  34. print ("begin.")
  35. while 1:
  36. _clog.debug("debug")
  37. _clog.info("info")
  38. _clog.warning("warning")
  39. _clog.error("error")

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/我家自动化/article/detail/865036
推荐阅读
相关标签
  

闽ICP备14008679号