mirror of
https://github.com/jomjol/AI-on-the-edge-device.git
synced 2025-12-07 03:56:57 +03:00
refactored check if logfile is enabled. error messages always get logged now
This commit is contained in:
@@ -118,16 +118,16 @@ static void mqtt_event_handler(void *handler_args, esp_event_base_t base, int32_
|
||||
void MQTT_Configure(std::string _mqttURI, std::string _clientid, std::string _user, std::string _password, std::string _maintopic, std::string _lwt, int _keepalive){
|
||||
#ifdef __HIDE_PASSWORD
|
||||
LogFile.WriteToFile(ESP_LOG_INFO, "MQTT Configuration: uri: " + _mqttURI + ", clientname: " + _clientid +
|
||||
", user: " + _user + ", password: XXXXXXXX, last-will-topic: " + _maintopic + _lwt + ", keepAlive: " + std::to_string(_keepalive));
|
||||
", user: " + _user + ", password: XXXXXXXX, last-will-topic: " + _maintopic + "/" + _lwt + ", keepAlive: " + std::to_string(_keepalive));
|
||||
#else
|
||||
LogFile.WriteToFile(ESP_LOG_INFO, "MQTT Configuration: uri: " + _mqttURI + ", clientname: " + _clientid +
|
||||
", user: " + _user + ", password: " + _password + ", last-will-topic: " + _maintopic + _lwt + ", keepAlive: " + std::to_string(_keepalive));
|
||||
", user: " + _user + ", password: " + _password + ", last-will-topic: " + _maintopic + "/" + _lwt + ", keepAlive: " + std::to_string(_keepalive));
|
||||
#endif
|
||||
|
||||
|
||||
uri = _mqttURI;
|
||||
client_id = _clientid;
|
||||
lwt_topic = _lwt;
|
||||
lwt_topic = _maintopic + "/" + _lwt;
|
||||
keepalive = _keepalive;
|
||||
|
||||
if (_user.length() && _password.length()){
|
||||
@@ -136,7 +136,7 @@ void MQTT_Configure(std::string _mqttURI, std::string _clientid, std::string _us
|
||||
}
|
||||
|
||||
|
||||
LogFile.WriteToFile(ESP_LOG_INFO, "MQTT maintopic: %s", _maintopic.c_str());
|
||||
LogFile.WriteToFile(ESP_LOG_INFO, "MQTT maintopic: " + _maintopic);
|
||||
}
|
||||
|
||||
bool MQTT_Init() {
|
||||
|
||||
Reference in New Issue
Block a user