[education/kstars] kstars/ekos/scheduler: Bugfix replacing output to stderr by debug log output

Jasem Mutlaq <[email protected]>
Newsgroups gmane.comp.kde.cvs
Message-ID <[email protected]>
Git commit 2a702768c1b338e6825b6e277a3a556cdc25c26a by Jasem Mutlaq, on behalf of Wolfgang Reissenberger.
Committed on 28/07/2026 at 04:00.
Pushed by mutlaqja into branch 'master'.

Bugfix replacing output to stderr by debug log output

The scheduler had some output to stderr, which is replaced by an output by qCDebug.

M  +0    -1    kstars/ekos/scheduler/greedyscheduler.cpp
M  +11   -12   kstars/ekos/scheduler/schedulerjob.cpp

https://invent.kde.org/education/kstars/-/commit/2a702768c1b338e6825b6e277a3a556cdc25c26a

diff --git a/kstars/ekos/scheduler/greedyscheduler.cpp b/kstars/ekos/scheduler/greedyscheduler.cpp
index 80d3006083..714891f451 100644
--- a/kstars/ekos/scheduler/greedyscheduler.cpp
+++ b/kstars/ekos/scheduler/greedyscheduler.cpp
@@ -11,7 +11,6 @@
 #include "Options.h"
 #include "scheduler.h"
 #include "schedulermodulestate.h"
-#include "ekos/ekos.h"
 #include "ui_scheduler.h"
 #include "schedulerjob.h"
 #include "schedulerutils.h"
diff --git a/kstars/ekos/scheduler/schedulerjob.cpp b/kstars/ekos/scheduler/schedulerjob.cpp
index 8d9ff57294..4126f5f0e7 100644
--- a/kstars/ekos/scheduler/schedulerjob.cpp
+++ b/kstars/ekos/scheduler/schedulerjob.cpp
@@ -924,18 +924,17 @@ bool SchedulerJob::runsDuringAstronomicalNightTimeInternal(const QDateTime &time
             result = true;
     }
 
-    fprintf(stderr, "DEBUG runsDuringAstronomicalNightTimeInternal: "
-                    "time.isValid=%d startupTime=%s t=%s nDawn=%s nDusk=%s earlyDawn=%s "
-                    "nDawn<nDusk=%d t<=earlyDawn=%d result=%d\n",
-            time.isValid() ? 1 : 0,
-            startupTime.toString("yyyy-MM-dd hh:mm:ss").toLocal8Bit().data(),
-            t.toString("yyyy-MM-dd hh:mm:ss").toLocal8Bit().data(),
-            nDawn.toString("yyyy-MM-dd hh:mm:ss").toLocal8Bit().data(),
-            nDusk.toString("yyyy-MM-dd hh:mm:ss").toLocal8Bit().data(),
-            earlyDawn.toString("yyyy-MM-dd hh:mm:ss").toLocal8Bit().data(),
-            (nDawn < nDusk) ? 1 : 0,
-            (t <= earlyDawn) ? 1 : 0,
-            result ? 1 : 0);
+    qCDebug(KSTARS_EKOS_SCHEDULER) <<
+                                   QString("runsDuringAstronomicalNightTimeInternal: time.isValid=%1 startupTime=%2 t=%3 nDawn=%4 nDusk=%5 earlyDawn=%6 nDawn<nDusk=%7 t<=earlyDawn=%8 result=%9\n")
+                                   .arg(time.isValid() ? 1 : 0)
+                                   .arg(startupTime.toString("yyyy-MM-dd hh:mm:ss").toLocal8Bit().data())
+                                   .arg(t.toString("yyyy-MM-dd hh:mm:ss").toLocal8Bit().data())
+                                   .arg(nDawn.toString("yyyy-MM-dd hh:mm:ss").toLocal8Bit().data())
+                                   .arg(nDusk.toString("yyyy-MM-dd hh:mm:ss").toLocal8Bit().data())
+                                   .arg(earlyDawn.toString("yyyy-MM-dd hh:mm:ss").toLocal8Bit().data())
+                                   .arg((nDawn < nDusk) ? 1 : 0)
+                                   .arg((t <= earlyDawn) ? 1 : 0)
+                                   .arg(result ? 1 : 0);
 
     // Return a hint about when it might succeed.
     if (nextPossibleSuccess != nullptr)
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.