Added terminal-debug-output.

This commit is contained in:
Gerhard Hoffmann 2023-08-04 13:49:32 +02:00
parent 4ad370ea46
commit c4f12ce75a

View File

@ -256,11 +256,13 @@ bool Worker::backendConnected() {
static int repeat = 0; static int repeat = 0;
if (repeat < 3) { if (repeat < 3) {
qCritical() << "In backendConnected() -> #M=APISM#C=REQ_SELF#J={}";
std::optional<QString> result std::optional<QString> result
= IsmasClient::sendRequestReceiveResponse( = IsmasClient::sendRequestReceiveResponse(
IsmasClient::APISM::DIRECT_PORT, "#M=APISM#C=REQ_SELF#J={}"); IsmasClient::APISM::DIRECT_PORT, "#M=APISM#C=REQ_SELF#J={}");
if (result) { if (result) {
QString msg = result.value(); QString msg = result.value();
qCritical() << "In backendConnected() -> APISM response" << msg;
QJsonParseError parseError; QJsonParseError parseError;
QJsonDocument document(QJsonDocument::fromJson(msg.toUtf8(), &parseError)); QJsonDocument document(QJsonDocument::fromJson(msg.toUtf8(), &parseError));
if (parseError.error != QJsonParseError::NoError) { if (parseError.error != QJsonParseError::NoError) {
@ -283,7 +285,7 @@ bool Worker::backendConnected() {
bool ismas = obj.value("ISMAS").toBool(); bool ismas = obj.value("ISMAS").toBool();
QString status = obj.value("Broker").toString(); QString status = obj.value("Broker").toString();
qCritical() << "STATUS" << status; qCritical() << "In backendConnected() STATUS" << status;
if (ismas) { if (ismas) {
if (status == "Connected") { if (status == "Connected") {
@ -305,6 +307,8 @@ bool Worker::backendConnected() {
} }
} }
} }
qCritical() << "In backendConnected() ERROR";
m_updateStatus = UpdateStatus(UPDATE_STATUS::BACKEND_NOT_CONNECTED, m_updateStatus = UpdateStatus(UPDATE_STATUS::BACKEND_NOT_CONNECTED,
QString("NO BACKEND CONNECTION")); QString("NO BACKEND CONNECTION"));
IsmasClient::sendRequestReceiveResponse(IsmasClient::APISM::DB_PORT, IsmasClient::sendRequestReceiveResponse(IsmasClient::APISM::DB_PORT,
@ -553,9 +557,14 @@ bool Worker::syncCustomerRepositoryAndFS() {
Command c("bash"); Command c("bash");
qInfo() << "EXECUTING CMD..." << cmd; qInfo() << "EXECUTING CMD..." << cmd;
if (c.execute(m_customerRepository, QStringList() << "-c" << 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 { } else {
qCritical() << "CMD" << cmd << "FAILED"; qCritical() << "CMD" << cmd << "FAILED";
qCritical() << c.getCommandResult().split('\n');
error = true; error = true;
} }
} }