[education/rkward] rkward: More debug info
Thomas Friedrichsmeier
null at kde.org
Sun Jul 31 10:12:34 BST 2022
Git commit 5e80617d8136f77ee769a92f8b5d76b74efe1d6d by Thomas Friedrichsmeier.
Committed on 31/07/2022 at 09:12.
Pushed by tfry into branch 'master'.
More debug info
M +3 -0 rkward/main.cpp
M +1 -1 rkward/rbackend/rkbackendtransmitter.cpp
M +4 -4 rkward/rbackend/rkfrontendtransmitter.cpp
M +2 -0 rkward/rbackend/rkrbackendprotocol_backend.cpp
https://invent.kde.org/education/rkward/commit/5e80617d8136f77ee769a92f8b5d76b74efe1d6d
diff --git a/rkward/main.cpp b/rkward/main.cpp
index a85fe7ca..c7c5e56a 100644
--- a/rkward/main.cpp
+++ b/rkward/main.cpp
@@ -312,6 +312,9 @@ int main (int argc, char *argv[]) {
RK_DEBUG (APP, DL_INFO, "Failed to open debug file %s", qPrintable (RK_Debug::debug_file->fileName ()));
}
qInstallMessageHandler (RKDebugMessageOutput);
+ RK_DO({
+ RK_DEBUG(APP, DL_DEBUG, "Basic runtime info (expected to be incomplete at this stage):\n%s", qPrintable(RKSessionVars::frontendSessionInfo().join("\n")));
+ }, APP, DL_DEBUG);
// handle positional (file) arguments, first
QStringList url_args = parser.positionalArguments ();
diff --git a/rkward/rbackend/rkbackendtransmitter.cpp b/rkward/rbackend/rkbackendtransmitter.cpp
index 1dfd02e7..3856e373 100644
--- a/rkward/rbackend/rkbackendtransmitter.cpp
+++ b/rkward/rbackend/rkbackendtransmitter.cpp
@@ -57,7 +57,7 @@ void RKRBackendTransmitter::run () {
if (timeout >= 20) handleTransmissionError("Could not connect: " + connection->errorString());
// handshake
- RK_DEBUG(RBACKEND, DL_DEBUG, "Sending handshake");
+ RK_DEBUG(RBACKEND, DL_DEBUG, "Connection state: %d. Now Sending handshake", con->state());
connection->write (token.toLocal8Bit ().data ());
connection->write ("\n");
connection->write (RKWARD_VERSION);
diff --git a/rkward/rbackend/rkfrontendtransmitter.cpp b/rkward/rbackend/rkfrontendtransmitter.cpp
index 6e84042b..6210023b 100644
--- a/rkward/rbackend/rkfrontendtransmitter.cpp
+++ b/rkward/rbackend/rkfrontendtransmitter.cpp
@@ -115,10 +115,10 @@ void RKFrontendTransmitter::run () {
args.append ("--rkd-server-name=" + rkd_transmitter->serverName ().toUtf8 ().toPercentEncoding ());
args.append ("--data-dir=" + RKSettingsModuleGeneral::filesPath ().toUtf8 ().toPercentEncoding ());
args.append ("--locale-dir=" + localeDir ().toUtf8 ().toPercentEncoding ());
- if (DL_DEBUG >= RK_Debug::RK_Debug_Level) {
- qDebug("%s", qPrintable(RKSessionVars::RBinary()));
- qDebug("%s", qPrintable(args.join("\n")));
- }
+ RK_DO({
+ RK_DEBUG(RBACKEND, DL_DEBUG, "R binary: %s", qPrintable(RKSessionVars::RBinary()));
+ RK_DEBUG(RBACKEND, DL_DEBUG, "%s", qPrintable(args.join("\n")));
+ }, RBACKEND, DL_DEBUG);
#ifdef Q_OS_MACOS
// Resolving libR.dylib and friends is a pain on MacOS, and running through R CMD does not always seem to be enough.
diff --git a/rkward/rbackend/rkrbackendprotocol_backend.cpp b/rkward/rbackend/rkrbackendprotocol_backend.cpp
index 64c2c586..b5b0696c 100644
--- a/rkward/rbackend/rkrbackendprotocol_backend.cpp
+++ b/rkward/rbackend/rkrbackendprotocol_backend.cpp
@@ -102,6 +102,8 @@ SPDX-License-Identifier: GPL-2.0-or-later
printf ("no server to connect to\n");
return 1;
}
+ RK_DEBUG(RBACKEND, DL_DEBUG, "Qt version (runtime): %s", qVersion());
+ RK_DEBUG(RBACKEND, DL_DEBUG, "Qt version (compile time): %s", QT_VERSION_STR);
// a simple security token to send to the frontend to make sure that it is really talking to the backend process that it started in the local socket connection.
// this token is sent both via stdout and the local socket connection. The frontend simply compares both values.
More information about the rkward-tracker
mailing list