From c4f12ce75af1f28caafbd633bdabf5b06cea536e Mon Sep 17 00:00:00 2001 From: Gerhard Hoffmann Date: Fri, 4 Aug 2023 13:49:32 +0200 Subject: [PATCH] Added terminal-debug-output. --- worker.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/worker.cpp b/worker.cpp index a0d17dc..0e70561 100644 --- a/worker.cpp +++ b/worker.cpp @@ -256,11 +256,13 @@ bool Worker::backendConnected() { static int repeat = 0; if (repeat < 3) { + qCritical() << "In backendConnected() -> #M=APISM#C=REQ_SELF#J={}"; std::optional result = IsmasClient::sendRequestReceiveResponse( IsmasClient::APISM::DIRECT_PORT, "#M=APISM#C=REQ_SELF#J={}"); if (result) { QString msg = result.value(); + qCritical() << "In backendConnected() -> APISM response" << msg; QJsonParseError parseError; QJsonDocument document(QJsonDocument::fromJson(msg.toUtf8(), &parseError)); if (parseError.error != QJsonParseError::NoError) { @@ -283,7 +285,7 @@ bool Worker::backendConnected() { bool ismas = obj.value("ISMAS").toBool(); QString status = obj.value("Broker").toString(); - qCritical() << "STATUS" << status; + qCritical() << "In backendConnected() STATUS" << status; if (ismas) { if (status == "Connected") { @@ -305,6 +307,8 @@ bool Worker::backendConnected() { } } } + qCritical() << "In backendConnected() ERROR"; + m_updateStatus = UpdateStatus(UPDATE_STATUS::BACKEND_NOT_CONNECTED, QString("NO BACKEND CONNECTION")); IsmasClient::sendRequestReceiveResponse(IsmasClient::APISM::DB_PORT, @@ -553,9 +557,14 @@ bool Worker::syncCustomerRepositoryAndFS() { Command c("bash"); qInfo() << "EXECUTING CMD..." << cmd; if (c.execute(m_customerRepository, QStringList() << "-c" << cmd)) { - qCritical() << c.getCommandResult() << "SUCCESS"; + QStringList result = c.getCommandResult().split('\n'); + for (int i = 0; i < result.size(); ++i) { + qCritical() << result.at(i); + } + qCritical() << "SUCCESS"; } else { qCritical() << "CMD" << cmd << "FAILED"; + qCritical() << c.getCommandResult().split('\n'); error = true; } }