From 9d2bb398768c93ebc47db81d41a80b9668b21259 Mon Sep 17 00:00:00 2001 From: Michael Zanetti Date: Tue, 30 Apr 2019 12:22:36 +0200 Subject: [PATCH] Add some better debug prints --- libnymea-app-core/jsonrpc/jsonrpcclient.cpp | 2 ++ nymea-app/applogcontroller.cpp | 5 ++--- nymea-app/main.cpp | 3 +-- nymea-app/ui/system/DeveloperTools.qml | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/libnymea-app-core/jsonrpc/jsonrpcclient.cpp b/libnymea-app-core/jsonrpc/jsonrpcclient.cpp index bd8ec6c2..159045ab 100644 --- a/libnymea-app-core/jsonrpc/jsonrpcclient.cpp +++ b/libnymea-app-core/jsonrpc/jsonrpcclient.cpp @@ -311,6 +311,7 @@ void JsonRpcClient::sendRequest(const QVariantMap &request) void JsonRpcClient::onInterfaceConnectedChanged(bool connected) { if (!connected) { + qDebug() << "JsonRpcClient: Transport disconnected."; m_initialSetupRequired = false; m_authenticationRequired = false; if (m_connected) { @@ -318,6 +319,7 @@ void JsonRpcClient::onInterfaceConnectedChanged(bool connected) emit connectedChanged(false); } } else { + qDebug() << "JsonRpcClient: Transport connected. Starting handshake."; QVariantMap params; params.insert("locale", QLocale().name()); sendCommand("JSONRPC.Hello", params, this, "helloReply"); diff --git a/nymea-app/applogcontroller.cpp b/nymea-app/applogcontroller.cpp index f3c8a220..223d59fb 100644 --- a/nymea-app/applogcontroller.cpp +++ b/nymea-app/applogcontroller.cpp @@ -30,7 +30,6 @@ AppLogController::AppLogController(QObject *parent) : QAbstractListModel(parent) QString fileName = QStandardPaths::writableLocation(QStandardPaths::CacheLocation) + "/nymea-app.log"; m_logFile.setFileName(fileName); - qDebug() << "App log file:" << fileName; if (QFile::exists(fileName)) { if (QFile::exists(fileName + ".old")) { @@ -44,7 +43,6 @@ AppLogController::AppLogController(QObject *parent) : QAbstractListModel(parent) return; } - qDebug() << "Logging is" << (enabled() ? "enabled" : "disabled"); if (enabled()) { activate(); } @@ -143,7 +141,8 @@ void AppLogController::append(const QString &message, AppLogController::Type typ void AppLogController::activate() { - qDebug() << "Activating log file writing"; + qDebug() << "Activating log file writing to" << m_logFile.fileName(); + s_oldLogMessageHandler = qInstallMessageHandler(&logMessageHandler); } diff --git a/nymea-app/main.cpp b/nymea-app/main.cpp index d92eaeb9..8c33bf1f 100644 --- a/nymea-app/main.cpp +++ b/nymea-app/main.cpp @@ -89,6 +89,7 @@ int main(int argc, char *argv[]) QLibraryInfo::location(QLibraryInfo::TranslationsPath)); application.installTranslator(&qtTranslator); + qDebug() << "nymea:app" << APP_VERSION << "running on" << QSysInfo::machineHostName() << QSysInfo::prettyProductName() << QSysInfo::productType() << QSysInfo::productVersion(); qDebug() << "Locale info:" << QLocale() << QLocale().name() << QLocale().language() << QLocale().system(); QTranslator appTranslator; @@ -100,8 +101,6 @@ int main(int argc, char *argv[]) } application.installTranslator(&appTranslator); - qDebug() << "Running on" << QSysInfo::machineHostName() << QSysInfo::prettyProductName() << QSysInfo::productType() << QSysInfo::productVersion(); - registerQmlTypes(); QQmlApplicationEngine *engine = new QQmlApplicationEngine(); diff --git a/nymea-app/ui/system/DeveloperTools.qml b/nymea-app/ui/system/DeveloperTools.qml index 7f2bd888..9fe5cc75 100644 --- a/nymea-app/ui/system/DeveloperTools.qml +++ b/nymea-app/ui/system/DeveloperTools.qml @@ -21,7 +21,7 @@ Page { // This one prefers https over http... // if (config === null || (!config.sslEnabled && tmp.sslEnabled)) { - // ...but for now, prefer http because some things won't work with self signed certs etc... + // ...but for now, prefer http because self signed certs cause trouble and this is meant for local debugging only anyways... if (config === null || (config.sslEnabled && !tmp.sslEnabled)) { config = tmp; }