mirror of
https://github.com/IoTManagerProject/IoTManager.git
synced 2026-03-27 06:32:19 +03:00
Debug changed
This commit is contained in:
@@ -5,7 +5,6 @@
|
||||
|
||||
void sendLogData(String file, String topic);
|
||||
|
||||
static const char* MODULE = "Log";
|
||||
|
||||
#ifdef LOGGING_ENABLED
|
||||
//===============================================Логирование============================================================
|
||||
@@ -30,7 +29,7 @@ void logging() {
|
||||
LOG1, period_min.toInt() * 1000 * 60, [&](void*) {
|
||||
String tmp_buf_1 = selectFromMarkerToMarker(logging_value_names_list, ",", 0);
|
||||
deleteOldDate("log." + tmp_buf_1 + ".txt", jsonReadInt(configOptionJson, tmp_buf_1 + "_c"), jsonReadStr(configLiveJson, tmp_buf_1));
|
||||
pm.info("logging for " + tmp_buf_1 + " done");
|
||||
SerialPrint("I","module","logging for " + tmp_buf_1 + " done");
|
||||
},
|
||||
nullptr, false);
|
||||
}
|
||||
@@ -39,7 +38,7 @@ void logging() {
|
||||
LOG2, period_min.toInt() * 1000 * 60, [&](void*) {
|
||||
String tmp_buf_2 = selectFromMarkerToMarker(logging_value_names_list, ",", 1);
|
||||
deleteOldDate("log." + tmp_buf_2 + ".txt", jsonReadInt(configOptionJson, tmp_buf_2 + "_c"), jsonReadStr(configLiveJson, tmp_buf_2));
|
||||
pm.info("logging for " + tmp_buf_2 + " done");
|
||||
SerialPrint("I","module","logging for " + tmp_buf_2 + " done");
|
||||
},
|
||||
nullptr, false);
|
||||
}
|
||||
@@ -48,7 +47,7 @@ void logging() {
|
||||
LOG3, period_min.toInt() * 1000 * 60, [&](void*) {
|
||||
String tmp_buf_3 = selectFromMarkerToMarker(logging_value_names_list, ",", 2);
|
||||
deleteOldDate("log." + tmp_buf_3 + ".txt", jsonReadInt(configOptionJson, tmp_buf_3 + "_c"), jsonReadStr(configLiveJson, tmp_buf_3));
|
||||
pm.info("logging for " + tmp_buf_3 + " done");
|
||||
SerialPrint("I","module","logging for " + tmp_buf_3 + " done");
|
||||
},
|
||||
nullptr, false);
|
||||
}
|
||||
@@ -57,7 +56,7 @@ void logging() {
|
||||
LOG4, period_min.toInt() * 1000 * 60, [&](void*) {
|
||||
String tmp_buf_4 = selectFromMarkerToMarker(logging_value_names_list, ",", 3);
|
||||
deleteOldDate("log." + tmp_buf_4 + ".txt", jsonReadInt(configOptionJson, tmp_buf_4 + "_c"), jsonReadStr(configLiveJson, tmp_buf_4));
|
||||
pm.info("logging for " + tmp_buf_4 + " done");
|
||||
SerialPrint("I","module","logging for " + tmp_buf_4 + " done");
|
||||
},
|
||||
nullptr, false);
|
||||
}
|
||||
@@ -66,7 +65,7 @@ void logging() {
|
||||
LOG5, period_min.toInt() * 1000 * 60, [&](void*) {
|
||||
String tmp_buf_5 = selectFromMarkerToMarker(logging_value_names_list, ",", 4);
|
||||
deleteOldDate("log." + tmp_buf_5 + ".txt", jsonReadInt(configOptionJson, tmp_buf_5 + "_c"), jsonReadStr(configLiveJson, tmp_buf_5));
|
||||
pm.info("logging for " + tmp_buf_5 + " done");
|
||||
SerialPrint("I","module","logging for " + tmp_buf_5 + " done");
|
||||
},
|
||||
nullptr, false);
|
||||
}
|
||||
@@ -79,7 +78,7 @@ void deleteOldDate(const String filename, size_t max_lines_cnt, String payload)
|
||||
String log_date = readFile(filename, 5120);
|
||||
size_t lines_cnt = itemsCount(log_date, "\r\n");
|
||||
|
||||
pm.info("log " + filename + " (" + String(lines_cnt, DEC) + ")");
|
||||
SerialPrint("I","module","log " + filename + " (" + String(lines_cnt, DEC) + ")");
|
||||
|
||||
if ((lines_cnt > max_lines_cnt + 1) || !lines_cnt) {
|
||||
removeFile(filename);
|
||||
@@ -136,7 +135,7 @@ void sendLogData(String file, String topic) {
|
||||
value = "";
|
||||
log_date = "";
|
||||
json_array = "{\"status\":[" + json_array + "]}";
|
||||
pm.info(json_array);
|
||||
SerialPrint("I","module",json_array);
|
||||
|
||||
MqttClient::publishChart(topic, json_array);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user