Commit 98b52f09 authored by Micha Mueller's avatar Micha Mueller
Browse files

Minor improvemement to logging output when loading plugins

parent af576287
......@@ -181,6 +181,11 @@ bool Configuration::read() {
//read in config
std::vector<Sensor*>& sensors = dynLib.configurator->readConfig(pluginConfig);
// returning an empty vector sensor may indicate problems with the config file
if(sensors.size() == 0) {
LOG(warning) << "Plugin \"" << plugin.second.data() << "\" created no sensors!";
}
//save only pointers to the sensors; copy-constructing an dynamically loaded object may lead to segfaults
//but before storing them, check if an MQTT-suffix was assigned twice
for(auto s : sensors) {
......@@ -194,10 +199,10 @@ bool Configuration::read() {
//save dl-struct
_plugins.push_back(dynLib);
LOG(info) << "Plugin \"" << plugin.second.data() << "\" loaded!";
} else {
LOG(info) << pluginConfig << " not found. Omitting";
}
LOG(info) << "Plugin \"" << plugin.second.data() << "\" successfully loaded!";
}
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment