make mqtt logging configurable
This commit is contained in:
@@ -41,10 +41,16 @@ WifiDevice::WifiDevice(const String& hostname, Preferences* _preferences)
|
||||
_mqttClient = new PubSubClient(*_wifiClient);
|
||||
}
|
||||
|
||||
String pathStr = _preferences->getString(preference_mqtt_lock_path);
|
||||
pathStr.concat(mqtt_topic_log);
|
||||
strcpy(_path, pathStr.c_str());
|
||||
Log = new MqttLogger(*_mqttClient, _path);
|
||||
if(_preferences->getBool(preference_mqtt_log_enabled))
|
||||
{
|
||||
_path = new char[200];
|
||||
memset(_path, 0, sizeof(_path));
|
||||
|
||||
String pathStr = _preferences->getString(preference_mqtt_lock_path);
|
||||
pathStr.concat(mqtt_topic_log);
|
||||
strcpy(_path, pathStr.c_str());
|
||||
Log = new MqttLogger(*_mqttClient, _path);
|
||||
}
|
||||
}
|
||||
|
||||
PubSubClient *WifiDevice::mqttClient()
|
||||
|
||||
Reference in New Issue
Block a user