瀏覽代碼

增加墒情控制默认数据

yf_yzl 2 年之前
父節點
當前提交
37c7562889
共有 2 個文件被更改,包括 6 次插入1 次删除
  1. 5 1
      kedong/settings.py
  2. 1 0
      smartfarming/api/views/forecast/send_control.py

+ 5 - 1
kedong/settings.py

@@ -212,7 +212,7 @@ LOGGING = {
             'when': 'midnight',
             'backupCount': 30,
             'encoding': 'utf-8',
-            'formatter': 'verbose'
+            'formatter': 'detail'
         }
     },
     'loggers': {
@@ -251,6 +251,10 @@ LOGGING = {
             'format': '{asctime} - {levelname} - {name} - {message}',
             'style': '{',
         },
+        'detail': {
+            "format": '%(asctime)s %(name)s  %(pathname)s:%(lineno)d %(module)s:%(funcName)s %(levelname)s- %(message)s',
+            "datefmt": "%Y-%m-%d %H:%M:%S"
+        }
     },
 }
 

+ 1 - 0
smartfarming/api/views/forecast/send_control.py

@@ -158,6 +158,7 @@ def device_control(request):
     )
     logger.warning(f"设备的返回值:{response}")
     response_code = response.status_code
+    logger.warning(f"控制响应码:{response_code}")
     if response_code == 200:
         device_config = MongoDeviceConfig.objects.get(d_id=d_id)
         device_config.device_config = str(payload)