Explorar o código

优化Google推送fcm日志打印

zhangdongming hai 7 meses
pai
achega
e43ead1b65
Modificáronse 1 ficheiros con 3 adicións e 2 borrados
  1. 3 2
      Service/PushService.py

+ 3 - 2
Service/PushService.py

@@ -28,6 +28,7 @@ from Service.CommonService import CommonService
 from Service.VivoPushService.push_admin.APIMessage import PushMessage
 from Service.VivoPushService.push_admin.APISender import APISender
 from AnsjerPush.config import LOGGER
+TIME_LOGGER = logging.getLogger('time')
 
 
 class PushObject:
@@ -180,10 +181,10 @@ class PushObject:
                                                                      'default_light_settings': True,
                                                                      },
                                                        )
-            LOGGER.info('fcm推送结果:{}'.format(result))
+            TIME_LOGGER.info('uid:{}fcm推送结果:{}'.format(uid, result))
             return True
         except Exception as e:
-            LOGGER.info('fcm推送异常:{}'.format(repr(e)))
+            TIME_LOGGER.error('uid:{}fcm推送异常:{}'.format(uid, repr(e)))
             return False
 
     @staticmethod