浏览代码

打印日志1

tanghongbin 5 年之前
父节点
当前提交
03a2bcf349
共有 1 个文件被更改,包括 8 次插入1 次删除
  1. 8 1
      Controller/DetectController.py

+ 8 - 1
Controller/DetectController.py

@@ -48,7 +48,7 @@ class NotificationView(View):
         return self.validation(request.POST)
 
     def validation(self, request_dict):
-        LogUtil.write_log(log='push----------{time}'.format(time=time.strftime('%Y-%m-%d-%H-%M-%S', time.localtime())))
+
         uidToken = request_dict.get('uidToken', None)
         etk = request_dict.get('etk', None)
         channel = request_dict.get('channel', '1')
@@ -69,6 +69,13 @@ class NotificationView(View):
         else:
             utko = UidTokenObject(uidToken)
             uid = utko.UID
+        log = 'push----------{time}'.format(time=time.strftime('%Y-%m-%d-%H-%M-%S', time.localtime()))
+        log += '\n'
+        log += '\tuid=' + uid
+        log += '\tchannel=' + channel
+        log += '\tevent_type=' + event_type
+        LogUtil.write_log(log=log)
+
         pkey = '{uid}_{channel}_{event_type}_ptl'.format(uid=uid, event_type=event_type, channel=channel)
         # ykey = 'MUJ887NLR8K8GBM9111A_redis_qs'.format(uid=uid)
         ykey = '{uid}_redis_qs'.format(uid=uid)