[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: [kstars] kstars: Simplyfing logs support. Adding colors to error and warning messages. Still lots of
From: Jasem Mutlaq <null () kde ! org>
Date: 2017-09-30 23:15:14
Message-ID: E1dyQyY-000874-BU () code ! kde ! org
[Download RAW message or body]
Git commit 4d6970694a77b49983d0c7ce98717a6e7f21b0bd by Jasem Mutlaq.
Committed on 30/09/2017 at 23:14.
Pushed by mutlaqja into branch 'master'.
Simplyfing logs support. Adding colors to error and warning messages. Still lots of \
work required
M +1 -0 kstars/CMakeLists.txt
A +428 -0 kstars/ekos/auxiliary/opslogs.ui
M +14 -1 kstars/ekos/ekosmanager.ui
M +12 -1 kstars/indi/indidevice.cpp
https://commits.kde.org/kstars/4d6970694a77b49983d0c7ce98717a6e7f21b0bd
diff --git a/kstars/CMakeLists.txt b/kstars/CMakeLists.txt
index 81daab106..3454ef3e5 100644
--- a/kstars/CMakeLists.txt
+++ b/kstars/CMakeLists.txt
@@ -167,6 +167,7 @@ if (INDI_FOUND)
#ekos/guide/rcalibration.ui
# Auxiliary
ekos/auxiliary/filtersettings.ui
+ ekos/auxiliary/opslogs.ui
)
set(ekos_SRCS
diff --git a/kstars/ekos/auxiliary/opslogs.ui b/kstars/ekos/auxiliary/opslogs.ui
new file mode 100644
index 000000000..ef22225ff
--- /dev/null
+++ b/kstars/ekos/auxiliary/opslogs.ui
@@ -0,0 +1,428 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>OpsAdvanced</class>
+ <widget class="QWidget" name="OpsAdvanced">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>465</width>
+ <height>261</height>
+ </rect>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout">
+ <property name="spacing">
+ <number>3</number>
+ </property>
+ <property name="leftMargin">
+ <number>3</number>
+ </property>
+ <property name="topMargin">
+ <number>3</number>
+ </property>
+ <property name="rightMargin">
+ <number>3</number>
+ </property>
+ <property name="bottomMargin">
+ <number>3</number>
+ </property>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_3">
+ <item>
+ <widget class="QLabel" name="label">
+ <property name="minimumSize">
+ <size>
+ <width>48</width>
+ <height>48</height>
+ </size>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>48</width>
+ <height>48</height>
+ </size>
+ </property>
+ <property name="text">
+ <string/>
+ </property>
+ <property name="pixmap">
+ <pixmap resource="../../data/kstars.qrc">:/icons/AlignWarning.svg</pixmap>
+ </property>
+ <property name="scaledContents">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="label_2">
+ <property name="text">
+ <string><html><head/><body><p>Enable Logs to \
diagnose issues with Ekos and INDI. Only enable the necessary logs to help in \
diagnosing specific problems. Logs consume resources and may slow the system down. \
Turn off logs when no longer used.</p></body></html></string> + \
</property> + <property name="wordWrap">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <widget class="QGroupBox" name="groupBox">
+ <property name="title">
+ <string>Logs</string>
+ </property>
+ <layout class="QGridLayout" name="gridLayout">
+ <item row="4" column="9" colspan="3">
+ <widget class="QCheckBox" name="kcfg_FocusLogging">
+ <property name="toolTip">
+ <string>Log Ekos Focus module activity</string>
+ </property>
+ <property name="text">
+ <string>Focus</string>
+ </property>
+ </widget>
+ </item>
+ <item row="5" column="7" colspan="2">
+ <widget class="QCheckBox" name="kcfg_MountLogging">
+ <property name="toolTip">
+ <string>Log Ekos Mount module activity</string>
+ </property>
+ <property name="text">
+ <string>Mount</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="3" colspan="3">
+ <widget class="QRadioButton" name="kcfg_LogToDefault">
+ <property name="toolTip">
+ <string>Log debug messages to default output device used by the platform \
(e.g. Standard Error)</string> + </property>
+ <property name="text">
+ <string>Defaul&t</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="6" colspan="2">
+ <widget class="QRadioButton" name="kcfg_RegularLogging">
+ <property name="toolTip">
+ <string>Enable regular debug output</string>
+ </property>
+ <property name="text">
+ <string>Reg&ular</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ <attribute name="buttonGroup">
+ <string notr="true">verbosityButtonGroup</string>
+ </attribute>
+ </widget>
+ </item>
+ <item row="5" column="2" colspan="3">
+ <widget class="QCheckBox" name="kcfg_AlignmentLogging">
+ <property name="toolTip">
+ <string>Log Ekos Alignment module activity</string>
+ </property>
+ <property name="text">
+ <string>Alignment</string>
+ </property>
+ </widget>
+ </item>
+ <item row="5" column="5" colspan="2">
+ <widget class="QCheckBox" name="kcfg_GuideLogging">
+ <property name="toolTip">
+ <string>Log Ekos Guide module activity</string>
+ </property>
+ <property name="text">
+ <string>Guide</string>
+ </property>
+ </widget>
+ </item>
+ <item row="8" column="2" colspan="2">
+ <widget class="QCheckBox" name="kcfg_INDIMountLogging">
+ <property name="toolTip">
+ <string>Log FITS processing activity</string>
+ </property>
+ <property name="text">
+ <string>Mount</string>
+ </property>
+ </widget>
+ </item>
+ <item row="8" column="7" colspan="2">
+ <widget class="QCheckBox" name="kcfg_INDIFocuserLogging">
+ <property name="toolTip">
+ <string>Log Ekos Capture module activity</string>
+ </property>
+ <property name="text">
+ <string>Focuser</string>
+ </property>
+ </widget>
+ </item>
+ <item row="8" column="5" colspan="2">
+ <widget class="QCheckBox" name="kcfg_INDICCDLogging">
+ <property name="toolTip">
+ <string>Log INDI devices activity</string>
+ </property>
+ <property name="text">
+ <string>CCD</string>
+ </property>
+ </widget>
+ </item>
+ <item row="8" column="1" rowspan="3">
+ <widget class="QLabel" name="label_9">
+ <property name="toolTip">
+ <string>Have problems with INDI drivers? Turn on logging for drivers that \
exhibit issues.</string> + </property>
+ <property name="text">
+ <string>Drivers</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="3" colspan="3">
+ <widget class="QRadioButton" name="kcfg_VerboseLogging">
+ <property name="toolTip">
+ <string>Enable verbose debug output</string>
+ </property>
+ <property name="text">
+ <string>&Verbose</string>
+ </property>
+ <attribute name="buttonGroup">
+ <string notr="true">verbosityButtonGroup</string>
+ </attribute>
+ </widget>
+ </item>
+ <item row="1" column="6" colspan="2">
+ <widget class="QRadioButton" name="kcfg_LogToFile">
+ <property name="toolTip">
+ <string>Log output to log file</string>
+ </property>
+ <property name="text">
+ <string>File</string>
+ </property>
+ </widget>
+ </item>
+ <item row="4" column="7" colspan="2">
+ <widget class="QCheckBox" name="kcfg_CaptureLogging">
+ <property name="toolTip">
+ <string>Log Ekos Capture module activity</string>
+ </property>
+ <property name="text">
+ <string>Capture</string>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="1" rowspan="3">
+ <widget class="QLabel" name="label_6">
+ <property name="toolTip">
+ <string>Have problem with Ekos? Turn on logging for Ekos modules that \
exhibit issues.</string> + </property>
+ <property name="text">
+ <string>Ekos</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="8" colspan="3">
+ <widget class="QRadioButton" name="kcfg_DisableLogging">
+ <property name="toolTip">
+ <string>Disable all logging output</string>
+ </property>
+ <property name="text">
+ <string>&Disable</string>
+ </property>
+ <property name="checked">
+ <bool>false</bool>
+ </property>
+ <attribute name="buttonGroup">
+ <string notr="true">verbosityButtonGroup</string>
+ </attribute>
+ </widget>
+ </item>
+ <item row="8" column="9" colspan="3">
+ <widget class="QCheckBox" name="kcfg_INDIFilterWheelLogging">
+ <property name="toolTip">
+ <string>Log Ekos Focus module activity</string>
+ </property>
+ <property name="text">
+ <string>Filter Wheel</string>
+ </property>
+ </widget>
+ </item>
+ <item row="6" column="0" colspan="13">
+ <widget class="Line" name="line_3">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ </widget>
+ </item>
+ <item row="4" column="2" colspan="2">
+ <widget class="QCheckBox" name="kcfg_FITSLogging">
+ <property name="toolTip">
+ <string>Log FITS processing activity</string>
+ </property>
+ <property name="text">
+ <string>FITS</string>
+ </property>
+ </widget>
+ </item>
+ <item row="4" column="5" colspan="2">
+ <widget class="QCheckBox" name="kcfg_INDILogging">
+ <property name="toolTip">
+ <string>Log INDI devices activity</string>
+ </property>
+ <property name="text">
+ <string>INDI</string>
+ </property>
+ </widget>
+ </item>
+ <item row="5" column="9" colspan="3">
+ <widget class="QCheckBox" name="kcfg_SchedulerLogging">
+ <property name="toolTip">
+ <string>Log Ekos Scheduler module activity</string>
+ </property>
+ <property name="text">
+ <string>Scheduler</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="0" rowspan="2" colspan="13">
+ <widget class="Line" name="line">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ </widget>
+ </item>
+ <item row="9" column="9">
+ <widget class="QCheckBox" name="kcfg_INDIAuxiliaryLogging">
+ <property name="toolTip">
+ <string>Log Ekos Scheduler module activity</string>
+ </property>
+ <property name="text">
+ <string>Auxiliary</string>
+ </property>
+ </widget>
+ </item>
+ <item row="9" column="7">
+ <widget class="QCheckBox" name="kcfg_INDIWeatherLogging">
+ <property name="toolTip">
+ <string>Log Ekos Mount module activity</string>
+ </property>
+ <property name="text">
+ <string>Weather</string>
+ </property>
+ </widget>
+ </item>
+ <item row="9" column="5">
+ <widget class="QCheckBox" name="kcfg_INDIAstrometryLogging">
+ <property name="toolTip">
+ <string>Log Ekos Guide module activity</string>
+ </property>
+ <property name="text">
+ <string>Astrometry</string>
+ </property>
+ </widget>
+ </item>
+ <item row="9" column="2">
+ <widget class="QCheckBox" name="kcfg_INDIDomeLogging">
+ <property name="toolTip">
+ <string>Log Ekos Alignment module activity</string>
+ </property>
+ <property name="text">
+ <string>Dome</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1" colspan="2">
+ <widget class="QLabel" name="label_5">
+ <property name="text">
+ <string>Output:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1" colspan="2">
+ <widget class="QLabel" name="label_4">
+ <property name="text">
+ <string>Verbosity:</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_2">
+ <item>
+ <widget class="QCheckBox" name="kcfg_showINDIMessages">
+ <property name="toolTip">
+ <string>Display INDI status messages in the status bar</string>
+ </property>
+ <property name="statusTip">
+ <string>Display incoming INDI status messages in KStars status bar</string>
+ </property>
+ <property name="whatsThis">
+ <string>Display incoming INDI status messages in KStars status bar</string>
+ </property>
+ <property name="text">
+ <string>INDI messages in status &bar</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="horizontalSpacer_8">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QPushButton" name="pushButton">
+ <property name="text">
+ <string>Enable All Logs</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="pushButton_2">
+ <property name="text">
+ <string>Disable All Logs</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="showLogsB">
+ <property name="styleSheet">
+ <string notr="true">font-weight:bold;</string>
+ </property>
+ <property name="text">
+ <string>Show Logs</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ <resources>
+ <include location="../../data/kstars.qrc"/>
+ </resources>
+ <connections/>
+ <buttongroups>
+ <buttongroup name="verbosityButtonGroup"/>
+ <buttongroup name="modulesGroup">
+ <property name="exclusive">
+ <bool>false</bool>
+ </property>
+ </buttongroup>
+ <buttongroup name="logbuttonGroup"/>
+ </buttongroups>
+</ui>
diff --git a/kstars/ekos/ekosmanager.ui b/kstars/ekos/ekosmanager.ui
index 13176a155..4300f8d51 100644
--- a/kstars/ekos/ekosmanager.ui
+++ b/kstars/ekos/ekosmanager.ui
@@ -304,6 +304,19 @@
</property>
</widget>
</item>
+ <item>
+ <widget class="QPushButton" name="logsB">
+ <property name="minimumSize">
+ <size>
+ <width>32</width>
+ <height>32</height>
+ </size>
+ </property>
+ <property name="text">
+ <string>Logs</string>
+ </property>
+ </widget>
+ </item>
<item>
<widget class="QPushButton" name="controlPanelB">
<property name="enabled">
@@ -1411,7 +1424,7 @@
</layout>
</widget>
</widget>
- <widget class="QWidget" name="">
+ <widget class="QWidget" name="layoutWidget">
<layout class="QHBoxLayout" name="bottomLayout">
<item>
<widget class="QPlainTextEdit" name="ekosLogOut">
diff --git a/kstars/indi/indidevice.cpp b/kstars/indi/indidevice.cpp
index 8da992706..89b25d76b 100644
--- a/kstars/indi/indidevice.cpp
+++ b/kstars/indi/indidevice.cpp
@@ -266,8 +266,19 @@ void INDI_D::updateMessageLog(INDI::BaseDevice *idv, int \
messageID) return;
QString message = QString::fromStdString(dv->messageQueue(messageID));
+ // TODO the colors should be from the color scheme
+ if (message.mid(21,2) == "[E")
+ message = QString("<b style='color:red'>%1</b>").arg(message);
+ else if (message.mid(21,2) == "[W")
+ message = QString("<b style='color:orange'>%1</b>").arg(message);
+ else if (message.mid(21,2) != "[I")
+ {
+ // Debug message
+ qCDebug(KSTARS_INDI) << idv->getDeviceName() << ": " << message.mid(21);
+ return;
+ }
msgST_w->ensureCursorVisible();
- msgST_w->insertPlainText(i18nc("Message shown in INDI control panel", "%1", \
message)); + msgST_w->insertHtml(i18nc("Message shown in INDI control panel", \
"%1", message)); msgST_w->insertPlainText("\n");
QTextCursor c = msgST_w->textCursor();
c.movePosition(QTextCursor::Start);
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic