mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
Logging enhancement / fixes (#1419)
* Instance in logging output * Fix: Trigger that previous log lines are shown in the Log UI
This commit is contained in:
@@ -56,6 +56,10 @@ void LedDeviceWrapper::createLedDevice(const QJsonObject& config)
|
||||
QThread* thread = new QThread(this);
|
||||
thread->setObjectName("LedDeviceThread");
|
||||
_ledDevice = LedDeviceFactory::construct(config);
|
||||
|
||||
QString subComponent = parent()->property("instance").toString();
|
||||
_ledDevice->setLogger(Logger::getInstance("LEDDEVICE", subComponent));
|
||||
|
||||
_ledDevice->moveToThread(thread);
|
||||
// setup thread management
|
||||
connect(thread, &QThread::started, _ledDevice, &LedDevice::start);
|
||||
@@ -92,13 +96,13 @@ QJsonObject LedDeviceWrapper::getLedDeviceSchemas()
|
||||
QString devName = item.remove("schema-");
|
||||
|
||||
QString data;
|
||||
if(!FileUtils::readFile(schemaPath, data, Logger::getInstance("LedDevice")))
|
||||
if(!FileUtils::readFile(schemaPath, data, Logger::getInstance("LEDDEVICE")))
|
||||
{
|
||||
throw std::runtime_error("ERROR: Schema not found: " + item.toStdString());
|
||||
}
|
||||
|
||||
QJsonObject schema;
|
||||
if(!JsonUtils::parse(schemaPath, data, schema, Logger::getInstance("LedDevice")))
|
||||
if(!JsonUtils::parse(schemaPath, data, schema, Logger::getInstance("LEDDEVICE")))
|
||||
{
|
||||
throw std::runtime_error("ERROR: JSON schema wrong of file: " + item.toStdString());
|
||||
}
|
||||
|
Reference in New Issue
Block a user