From b2f9eef0d5f460116acf1afd9562e90ce847d13c Mon Sep 17 00:00:00 2001 From: fanquake Date: Mon, 24 Jun 2019 09:15:38 +0800 Subject: [PATCH] Merge #16263: qt: Use qInfo() if no error occurs a2aabfb749198bce896c9e597082acd67d3b863e Use qInfo() if no error occurs (Hennadii Stepanov) Pull request description: [Warning and Debugging Messages](https://doc.qt.io/qt-5/debug.html#warning-and-debugging-messages): > - `qInfo()` is used for informational messages. > - `qWarning()` is used to report warnings and recoverable errors in your application. > > If the `QT_FATAL_WARNINGS` environment variable is set, `qWarning()` exits after printing the warning message. This makes it easy to obtain a backtrace in the debugger. [`qWarning()`](https://doc.qt.io/qt-5/qtglobal.html#qWarning): > Calls the message handler with the warning message message... This function does nothing if `QT_NO_WARNING_OUTPUT` was defined during compilation; it exits if at the nth warning corresponding to the counter in environment variable `QT_FATAL_WARNINGS`. This PR allows more productive debugging using the environment variable `QT_FATAL_WARNINGS`. Examples: - https://github.com/bitcoin/bitcoin/pull/16118#issuecomment-503184695 - https://github.com/bitcoin/bitcoin/pull/16254#issuecomment-504223404 The behavior, when option `-debug=qt` is set/unset, remains unchanged. ACKs for commit a2aabf: promag: ACK a2aabfb, I also have this change locally. Empact: ACK https://github.com/bitcoin/bitcoin/pull/16263/commits/a2aabfb749198bce896c9e597082acd67d3b863e laanwj: ACK a2aabfb749198bce896c9e597082acd67d3b863e fanquake: ACK a2aabfb749198bce896c9e597082acd67d3b863e. Tree-SHA512: b4df300c9c00a1705b0d3a10227e3deaac19a98b0a898bb60d5a88872cf450fb131eba150d9dd6c29e021566ee04b3b86b7d486bbe28bd894743c128d2309155 --- src/qt/dash.cpp | 2 +- src/qt/optionsmodel.cpp | 2 +- src/qt/paymentserver.cpp | 2 +- src/qt/winshutdownmonitor.cpp | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/qt/dash.cpp b/src/qt/dash.cpp index fa634fe821..764e33192e 100644 --- a/src/qt/dash.cpp +++ b/src/qt/dash.cpp @@ -344,7 +344,7 @@ void BitcoinApplication::initializeResult(bool success) if(success) { // Log this only after AppInitMain finishes, as then logging setup is guaranteed complete - qWarning() << "Platform customization:" << gArgs.GetArg("-uiplatform", BitcoinGUI::DEFAULT_UIPLATFORM).c_str(); + qInfo() << "Platform customization:" << gArgs.GetArg("-uiplatform", BitcoinGUI::DEFAULT_UIPLATFORM).c_str(); #ifdef ENABLE_WALLET m_wallet_controller = new WalletController(m_node, optionsModel, this); #ifdef ENABLE_BIP70 diff --git a/src/qt/optionsmodel.cpp b/src/qt/optionsmodel.cpp index 9af060cf46..84fd7c8d8c 100644 --- a/src/qt/optionsmodel.cpp +++ b/src/qt/optionsmodel.cpp @@ -296,7 +296,7 @@ static void CopySettings(QSettings& dst, const QSettings& src) /** Back up a QSettings to an ini-formatted file. */ static void BackupSettings(const fs::path& filename, const QSettings& src) { - qWarning() << "Backing up GUI settings to" << GUIUtil::boostPathToQString(filename); + qInfo() << "Backing up GUI settings to" << GUIUtil::boostPathToQString(filename); QSettings dst(GUIUtil::boostPathToQString(filename), QSettings::IniFormat); dst.clear(); CopySettings(dst, src); diff --git a/src/qt/paymentserver.cpp b/src/qt/paymentserver.cpp index 89daa02353..dc9031bbbb 100644 --- a/src/qt/paymentserver.cpp +++ b/src/qt/paymentserver.cpp @@ -493,7 +493,7 @@ void PaymentServer::LoadRootCAs(X509_STORE* _store) continue; } } - qWarning() << "PaymentServer::LoadRootCAs: Loaded " << nRootCerts << " root certificates"; + qInfo() << "PaymentServer::LoadRootCAs: Loaded " << nRootCerts << " root certificates"; // Project for another day: // Fetch certificate revocation lists, and add them to certStore. diff --git a/src/qt/winshutdownmonitor.cpp b/src/qt/winshutdownmonitor.cpp index b6f9cec05b..243abafb42 100644 --- a/src/qt/winshutdownmonitor.cpp +++ b/src/qt/winshutdownmonitor.cpp @@ -50,7 +50,7 @@ void WinShutdownMonitor::registerShutdownBlockReason(const QString& strReason, c } if (shutdownBRCreate(mainWinId, strReason.toStdWString().c_str())) - qWarning() << "registerShutdownBlockReason: Successfully registered: " + strReason; + qInfo() << "registerShutdownBlockReason: Successfully registered: " + strReason; else qWarning() << "registerShutdownBlockReason: Failed to register: " + strReason; }