Add tag to logfile write (#1287)

* HTML: implement data viewer

* Correct CSV error

* Improve OTA

* Use consistent Log TAG syntax, name TAG variable the same in every file.

* .

* .

* .

* .

* .

* Update server_tflite.cpp

* Correct CSV error

* Improve OTA

* Use consistent Log TAG syntax, name TAG variable the same in every file.

* .

* .

* .

* .

* .

* Update server_tflite.cpp

* .

* .

* .

* .

* .

* .

* .

* .

Co-authored-by: jomjol <30766535+jomjol@users.noreply.github.com>
This commit is contained in:
CaCO3
2022-11-06 08:13:53 +01:00
committed by GitHub
parent 529690ec60
commit d1e7ef1fce
31 changed files with 450 additions and 436 deletions

View File

@@ -137,7 +137,7 @@ void sendHomeAssistantDiscoveryTopic(std::string group, std::string field,
}
void MQTThomeassistantDiscovery() {
LogFile.WriteToFile(ESP_LOG_INFO, "MQTT - Sending Homeassistant Discovery Topics (Meter Type: " + meterType + ", Value Unit: " + valueUnit + " , Rate Unit: " + rateUnit + ")...");
LogFile.WriteToFile(ESP_LOG_INFO, TAG, "MQTT - Sending Homeassistant Discovery Topics (Meter Type: " + meterType + ", Value Unit: " + valueUnit + " , Rate Unit: " + rateUnit + ")...");
// Group | Field | User Friendly Name | Icon | Unit | Device Class | State Class | Entity Category
sendHomeAssistantDiscoveryTopic("", "uptime", "Uptime", "clock-time-eight-outline", "s", "", "", "diagnostic");
@@ -172,7 +172,7 @@ void MQTThomeassistantDiscovery() {
void publishSystemData() {
char tmp_char[50];
LogFile.WriteToFile(ESP_LOG_INFO, "Publishing system MQTT topics...");
LogFile.WriteToFile(ESP_LOG_INFO, TAG, "Publishing system MQTT topics...");
sprintf(tmp_char, "%ld", (long)getUpTime());
MQTTPublish(maintopic + "/" + "uptime", std::string(tmp_char), retainFlag);
@@ -189,7 +189,7 @@ void publishSystemData() {
void publishStaticData() {
LogFile.WriteToFile(ESP_LOG_INFO, "Publishing static MQTT topics...");
LogFile.WriteToFile(ESP_LOG_INFO, TAG, "Publishing static MQTT topics...");
MQTTPublish(maintopic + "/" + "MAC", getMac(), retainFlag);
MQTTPublish(maintopic + "/" + "IP", *getIPAddress(), retainFlag);
MQTTPublish(maintopic + "/" + "hostname", hostname, retainFlag);