Commit fd30589e authored by Jasem Mutlaq's avatar Jasem Mutlaq

Add debugging messages as needed

parent 0382eec5
......@@ -323,6 +323,9 @@ bool DriverManager::startDevices(QList<DriverInfo*> & dList)
getUniqueHosts(dList, uHosts);
if (Options::iNDILogging())
qDebug() << "INDI: Starting local drivers...";
foreach(QList <DriverInfo *> qdv, uHosts)
{
......@@ -361,6 +364,9 @@ bool DriverManager::startDevices(QList<DriverInfo*> & dList)
return false;
}
if (Options::iNDILogging())
qDebug() << "INDI: INDI Server started locally on port " << port;
foreach(DriverInfo *dv, qdv)
{
if (serverManager->startDriver(dv) == false)
......@@ -391,6 +397,9 @@ bool DriverManager::startDevices(QList<DriverInfo*> & dList)
for (int i=0; i < INDI_MAX_TRIES; i++)
{
if (Options::iNDILogging())
qDebug() << "INDI: Connecting to local INDI server on port " << port << " ...";
connectionToServer= clientManager->connectServer();
if (connectionToServer)
......@@ -403,7 +412,7 @@ bool DriverManager::startDevices(QList<DriverInfo*> & dList)
if (connectionToServer)
{
if (Options::verboseLogging())
if (Options::iNDILogging())
qDebug() << "Connection to INDI server is successful";
clients.append(clientManager);
......@@ -412,8 +421,11 @@ bool DriverManager::startDevices(QList<DriverInfo*> & dList)
else
{
if (Options::iNDILogging())
qDebug() << "INDI: Connection to local INDI server on port " << port << " failed!";
KNotification::beep();
QMessageBox* msgBox = new QMessageBox();
QPointer<QMessageBox> msgBox;
msgBox->setAttribute( Qt::WA_DeleteOnClose );
msgBox->setStandardButtons( QMessageBox::Ok );
msgBox->setWindowTitle( i18n("Error") );
......@@ -442,6 +454,9 @@ bool DriverManager::startDevices(QList<DriverInfo*> & dList)
void DriverManager::stopDevices(const QList<DriverInfo*> & dList)
{
if (Options::iNDILogging())
qDebug() << "INDI: Stopping local drivers...";
// #2 stop server
foreach(DriverInfo *dv, dList)
{
......
......@@ -149,15 +149,13 @@ bool ServerManager::startDriver(DriverInfo *dv)
return false;
}
//qDebug() << "Will run driver: " << dv->getName() << " with driver " << dv->getDriver() <<
// " Unique Label " << dv->getUniqueLabel() << endl;
out << "start " << dv->getDriver();
if (dv->getUniqueLabel().isEmpty() == false)
out << " -n \"" << dv->getUniqueLabel() << "\"";
if (dv->getSkeletonFile().isEmpty() == false)
out << " -s \"" << Options::indiDriversDir() << QDir::separator() << dv->getSkeletonFile() << "\"";
out << endl;
out.flush();
dv->setServerState(true);
......@@ -246,7 +244,15 @@ void ServerManager::processServerError(QProcess::ProcessError err)
void ServerManager::processStandardError()
{
serverBuffer.append(serverProcess->readAllStandardError());
QString stderr = serverProcess->readAllStandardError();
serverBuffer.append(stderr);
if (Options::iNDILogging())
{
foreach(QString msg, stderr.split("\n"))
qDebug() << "INDI Server: " << msg;
}
if (driverCrashed == false && (serverBuffer.contains("stdin EOF") || serverBuffer.contains("stderr EOF")))
{
......
Markdown is supported
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