소스 검색

加日志打印

zhangdongming 2 년 전
부모
커밋
6f422ac794
2개의 변경된 파일2개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 0
      Controller/DetectControllerV2.py
  2. 1 1
      Service/PushService.py

+ 1 - 0
Controller/DetectControllerV2.py

@@ -140,6 +140,7 @@ class NotificationV2View(View):
             params['uid_set_push_list'] = uid_set_push_list
             params['code_dict'] = result
             result_dict = DevicePushService.get_push_url(**params)  # 获取S3对象上传链接
+            logger.info('{}触发时间{},推送URL{}'.format(uid, n_time, json.dumps(result_dict)))
             return JsonResponse(status=200, data=result_dict)
         except Exception as e:
             logger.info('V2推送接口异常, errLine:{}, errMsg:{}'.format(e.__traceback__.tb_lineno, repr(e)))

+ 1 - 1
Service/PushService.py

@@ -130,7 +130,7 @@ class PushObject:
                                     mutable_content=True)
             n = apns2.Notification(payload=payload, priority=apns2.PRIORITY_LOW)
             res = cli.push(n=n, device_token=token_val, topic=app_bundle_id)
-            logger.info('IOS推送响应状态码{}'.format(res.status_code))
+            logger.info('IOS推送响应状态码{},params,uid:{},{}'.format(res.status_code, uid, json.dumps(push_data)))
             assert res.status_code == 200
         except Exception as e:
             logger.info('--->IOS推送异常{}'.format(repr(e)))