|
@@ -6,6 +6,7 @@
|
|
|
@IDE :PyCharm
|
|
|
"""
|
|
|
import json
|
|
|
+import logging
|
|
|
import time
|
|
|
from django.utils.deprecation import MiddlewareMixin
|
|
|
|
|
@@ -42,6 +43,8 @@ class RequestRecordMiddleware(MiddlewareMixin):
|
|
|
else: # 处理捕获异常的情况
|
|
|
print('content: ', response.content)
|
|
|
content = eval(str(response.content, 'utf-8')) # bytes 转为 dict
|
|
|
+ logger = logging.getLogger('info')
|
|
|
+ logger.info('content: {}'.format(content))
|
|
|
if content['result_code'] == 500:
|
|
|
print(content['result'])
|
|
|
request_record_data = {
|