Преглед изворни кода

Write slow HTTP timings into SD log

SybexXx пре 1 дан
родитељ
комит
a9682ae54d
1 измењених фајлова са 3 додато и 2 уклоњено
  1. 3 2
      code/main/server_main.cpp

+ 3 - 2
code/main/server_main.cpp

@@ -46,8 +46,9 @@ public:
         const int64_t elapsedUs = esp_timer_get_time() - startUs;
         const int64_t elapsedUs = esp_timer_get_time() - startUs;
         if (elapsedUs >= 250000)
         if (elapsedUs >= 250000)
         {
         {
-            ESP_LOGW(TAG, "Slow HTTP handler: %s took %lld ms",
-                     requestUri, (long long)(elapsedUs / 1000));
+            LogFile.WriteToFile(ESP_LOG_WARN, TAG,
+                                std::string("Slow HTTP handler: ") + requestUri + " took " +
+                                std::to_string((long long)(elapsedUs / 1000)) + " ms");
         }
         }
     }
     }