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;
if (repeat < 3) {
qCritical() << "In backendConnected() -> #M=APISM#C=REQ_SELF#J={}";
std::optional<QString> 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;
}
}