Skip to content

Commit 3611983

Browse files
committed
Added 'Log_Debug' flag for logging
1 parent 11f4ea2 commit 3611983

File tree

6 files changed

+14
-1
lines changed

6 files changed

+14
-1
lines changed

src/core/core/core.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ class MB_EXPORT mbCore : public mbCoreBase
105105
static inline void LogInfo (const QString &source, const QString &text) { s_globalCore->logInfo (source, text); }
106106
static inline void LogTx (const QString &source, const QString &text) { s_globalCore->logTx (source, text); }
107107
static inline void LogRx (const QString &source, const QString &text) { s_globalCore->logRx (source, text); }
108+
static inline void LogDebug (const QString &source, const QString &text) { s_globalCore->logDebug (source, text); }
108109
static inline void OutputMessage(const QString &text) { s_globalCore->outputMessage(text); }
109110

110111
public:
@@ -162,6 +163,7 @@ class MB_EXPORT mbCore : public mbCoreBase
162163
inline void logInfo (const QString &source, const QString &text) { logMessage(mb::Log_Info , source, text); }
163164
inline void logTx (const QString &source, const QString &text) { logMessage(mb::Log_Tx , source, text); }
164165
inline void logRx (const QString &source, const QString &text) { logMessage(mb::Log_Rx , source, text); }
166+
inline void logDebug (const QString &source, const QString &text) { logMessage(mb::Log_Debug , source, text); }
165167

166168
public: // output
167169
inline void outputMessage(const QString &text) { outputMessageThreadSafe(text); }

src/core/gui/dialogs/settings/core_widgetsettingslog.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ mb::LogFlags mbCoreWidgetSettingsLog::logFlags() const
2121
flags = static_cast<mb::LogFlags>(flags | (ui->chbLogInfo ->isChecked() * mb::Log_Info ));
2222
flags = static_cast<mb::LogFlags>(flags | (ui->chbLogTx ->isChecked() * mb::Log_Tx ));
2323
flags = static_cast<mb::LogFlags>(flags | (ui->chbLogRx ->isChecked() * mb::Log_Rx ));
24+
flags = static_cast<mb::LogFlags>(flags | (ui->chbLogDebug ->isChecked() * mb::Log_Debug ));
2425
return flags;
2526
}
2627

@@ -31,6 +32,7 @@ void mbCoreWidgetSettingsLog::setLogFlags(mb::LogFlags flags)
3132
ui->chbLogInfo ->setChecked(flags & mb::Log_Info );
3233
ui->chbLogTx ->setChecked(flags & mb::Log_Tx );
3334
ui->chbLogRx ->setChecked(flags & mb::Log_Rx );
35+
ui->chbLogDebug ->setChecked(flags & mb::Log_Debug );
3436
}
3537

3638
QString mbCoreWidgetSettingsLog::formatDateTime() const

src/core/gui/dialogs/settings/core_widgetsettingslog.ui

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,13 @@
5555
</property>
5656
</widget>
5757
</item>
58+
<item row="2" column="1">
59+
<widget class="QCheckBox" name="chbLogDebug">
60+
<property name="text">
61+
<string>Debug</string>
62+
</property>
63+
</widget>
64+
</item>
5865
</layout>
5966
</widget>
6067
</item>

src/core/sdk/mbcore.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -471,6 +471,7 @@ QString toString(LogFlag flag)
471471
case Log_Info : return QStringLiteral("Info");
472472
case Log_Tx : return QStringLiteral("Tx");
473473
case Log_Rx : return QStringLiteral("Rx");
474+
case Log_Debug : return QStringLiteral("Debug");
474475
default:
475476
return QString();
476477
}

src/core/sdk/mbcore.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,7 @@ enum LogFlag
309309
Log_Info = 0x00000004,
310310
Log_Tx = 0x00000008,
311311
Log_Rx = 0x00000010,
312+
Log_Debug = 0x00000020,
312313
// ---- Qt Message Flags ----
313314
Log_QtFatal = 0x08000000,
314315
Log_QtCritical = 0x10000000,

src/server/runtime/server_runscriptthread.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ void mbServerRunScriptThread::run()
209209

210210
py.setProcessChannelMode(QProcess::MergedChannels);
211211
connect(m_py, &QProcess::readyReadStandardOutput, this, &mbServerRunScriptThread::readPyStdOut);
212-
mbServer::LogInfo("Python", QString("Try start process '%1' with args '%2'").arg(pyfile, args.join(' ')));
212+
mbServer::LogDebug("Python", QString("Try start process '%1' with args '%2'").arg(pyfile, args.join(' ')));
213213
py.start(pyfile, args);
214214

215215
// Wait for start

0 commit comments

Comments
 (0)